diff --git a/library/Exceptions/SubdivisionCode/DjSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/DjSubdivisionCodeException.php new file mode 100644 index 00000000..b35cf6e8 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/DjSubdivisionCodeException.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 Djibouti subdivision code. + * + * ISO 3166-1 alpha-2: DJ + */ +class DjSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Djibouti', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Djibouti', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/DjSubdivisionCode.php b/library/Rules/SubdivisionCode/DjSubdivisionCode.php new file mode 100644 index 00000000..36d48d2b --- /dev/null +++ b/library/Rules/SubdivisionCode/DjSubdivisionCode.php @@ -0,0 +1,35 @@ + + * + * 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 Djibouti subdivision code. + * + * ISO 3166-1 alpha-2: DJ + * + * @link http://www.geonames.org/DJ/administrative-division-djibouti.html + */ +class DjSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'AR', // Arta + 'AS', // 'Ali Sabih + 'DI', // Dikhil + 'DJ', // Djibouti + 'OB', // Obock + 'TA', // Tadjoura + ); + + public $compareIdentical = true; +}