diff --git a/library/Exceptions/SubdivisionCode/CkSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/CkSubdivisionCodeException.php new file mode 100644 index 00000000..31114614 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/CkSubdivisionCodeException.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 Cook Islands subdivision code. + * + * ISO 3166-1 alpha-2: CK + */ +class CkSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Cook Islands', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Cook Islands', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/CkSubdivisionCode.php b/library/Rules/SubdivisionCode/CkSubdivisionCode.php new file mode 100644 index 00000000..2dc2c64d --- /dev/null +++ b/library/Rules/SubdivisionCode/CkSubdivisionCode.php @@ -0,0 +1,44 @@ + + * + * 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 Cook Islands subdivision code. + * + * ISO 3166-1 alpha-2: CK + * + * @link http://www.geonames.org/CK/administrative-division-cook-islands.html + */ +class CkSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'AI', // Aitutaki + 'AT', // Atiu + 'MA', // Manuae + 'MG', // Mangaia + 'MK', // Manihiki + 'MT', // Mitiaro + 'MU', // Mauke + 'NI', // Nassau Island + 'PA', // Palmerston + 'PE', // Penrhyn + 'PU', // Pukapuka + 'RK', // Rakahanga + 'RR', // Rarotonga + 'SU', // Surwarrow + 'TA', // Takutea + ); + + public $compareIdentical = true; +}