diff --git a/library/Exceptions/SubdivisionCode/CxSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/CxSubdivisionCodeException.php new file mode 100644 index 00000000..e028cd7e --- /dev/null +++ b/library/Exceptions/SubdivisionCode/CxSubdivisionCodeException.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 Christmas Island subdivision code. + * + * ISO 3166-1 alpha-2: CX + */ +class CxSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Christmas Island', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Christmas Island', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/CxSubdivisionCode.php b/library/Rules/SubdivisionCode/CxSubdivisionCode.php new file mode 100644 index 00000000..7a0ebab2 --- /dev/null +++ b/library/Rules/SubdivisionCode/CxSubdivisionCode.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 Christmas Island subdivision code. + * + * ISO 3166-1 alpha-2: CX + * + * @link http://www.geonames.org/CX/administrative-division-christmas-island.html + */ +class CxSubdivisionCode extends AbstractSearcher +{ + public $haystack = array(null, ''); + + public $compareIdentical = true; +}