diff --git a/library/Exceptions/SubdivisionCode/ImSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/ImSubdivisionCodeException.php new file mode 100644 index 00000000..1529092d --- /dev/null +++ b/library/Exceptions/SubdivisionCode/ImSubdivisionCodeException.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 Isle of Man subdivision code. + * + * ISO 3166-1 alpha-2: IM + */ +class ImSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Isle of Man', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Isle of Man', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/ImSubdivisionCode.php b/library/Rules/SubdivisionCode/ImSubdivisionCode.php new file mode 100644 index 00000000..614ee36a --- /dev/null +++ b/library/Rules/SubdivisionCode/ImSubdivisionCode.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 Isle of Man subdivision code. + * + * ISO 3166-1 alpha-2: IM + * + * @link http://www.geonames.org/IM/administrative-division-isle-of-man.html + */ +class ImSubdivisionCode extends AbstractSearcher +{ + public $haystack = array(null, ''); + + public $compareIdentical = true; +}