diff --git a/library/Exceptions/SubdivisionCode/TcSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/TcSubdivisionCodeException.php new file mode 100644 index 00000000..2d01d6bd --- /dev/null +++ b/library/Exceptions/SubdivisionCode/TcSubdivisionCodeException.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 Turks and Caicos Islands subdivision code. + * + * ISO 3166-1 alpha-2: TC + */ +class TcSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Turks and Caicos Islands', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Turks and Caicos Islands', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/TcSubdivisionCode.php b/library/Rules/SubdivisionCode/TcSubdivisionCode.php new file mode 100644 index 00000000..2e903459 --- /dev/null +++ b/library/Rules/SubdivisionCode/TcSubdivisionCode.php @@ -0,0 +1,43 @@ + + * + * 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 Turks and Caicos Islands subdivision code. + * + * ISO 3166-1 alpha-2: TC + * + * @link http://www.geonames.org/TC/administrative-division-turks-and-caicos-islands.html + */ +class TcSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'AC', // Ambergris Cays + 'DC', // Dellis Cay + 'EC', // East Caicos + 'FC', // French Cay + 'GT', // Grand Turk + 'LW', // Little Water Cay + 'MC', // Middle Caicos + 'NC', // North Caicos + 'PN', // Pine Cay + 'PR', // Providenciales + 'RC', // Parrot Cay + 'SC', // South Caicos + 'SL', // Salt Cay + 'WC', // West Caicos + ); + + public $compareIdentical = true; +}