diff --git a/library/Exceptions/SubdivisionCode/TfSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/TfSubdivisionCodeException.php new file mode 100644 index 00000000..11c1a6f0 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/TfSubdivisionCodeException.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the "LICENSE.md" + * file that was distributed with this source code. + */ + +namespace Respect\Validation\Exceptions\SubdivisionCode; + +use Respect\Validation\Exceptions\SubdivisionCodeException; + +/** + * Exception class for French Southern Territories subdivision code. + * + * ISO 3166-1 alpha-2: TF + */ +class TfSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of French Southern Territories', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of French Southern Territories', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/TfSubdivisionCode.php b/library/Rules/SubdivisionCode/TfSubdivisionCode.php new file mode 100644 index 00000000..0e4f5a8e --- /dev/null +++ b/library/Rules/SubdivisionCode/TfSubdivisionCode.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the "LICENSE.md" + * file that was distributed with this source code. + */ + +namespace Respect\Validation\Rules\SubdivisionCode; + +use Respect\Validation\Rules\AbstractSearcher; + +/** + * Validator for French Southern Territories subdivision code. + * + * ISO 3166-1 alpha-2: TF + * + * @link http://www.geonames.org/TF/administrative-division-french-southern-territories.html + */ +class TfSubdivisionCode extends AbstractSearcher +{ + public $haystack = array(null, ''); + + public $compareIdentical = true; +}