diff --git a/library/Exceptions/SubdivisionCode/KwSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/KwSubdivisionCodeException.php new file mode 100644 index 00000000..dc585e6f --- /dev/null +++ b/library/Exceptions/SubdivisionCode/KwSubdivisionCodeException.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 Kuwait subdivision code. + * + * ISO 3166-1 alpha-2: KW + */ +class KwSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Kuwait', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Kuwait', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/KwSubdivisionCode.php b/library/Rules/SubdivisionCode/KwSubdivisionCode.php new file mode 100644 index 00000000..64b21784 --- /dev/null +++ b/library/Rules/SubdivisionCode/KwSubdivisionCode.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 Kuwait subdivision code. + * + * ISO 3166-1 alpha-2: KW + * + * @link http://www.geonames.org/KW/administrative-division-kuwait.html + */ +class KwSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'AH', // Al Ahmadi + 'FA', // Al Farwaniyah + 'HA', // Hawalli + 'JA', // Al Jahra + 'KU', // Al Asimah + 'MU', // Mubārak al Kabīr + ); + + public $compareIdentical = true; +}