diff --git a/library/Exceptions/SubdivisionCode/BnSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/BnSubdivisionCodeException.php new file mode 100644 index 00000000..3bb05532 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/BnSubdivisionCodeException.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 Brunei subdivision code. + * + * ISO 3166-1 alpha-2: BN + */ +class BnSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Brunei', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Brunei', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/BnSubdivisionCode.php b/library/Rules/SubdivisionCode/BnSubdivisionCode.php new file mode 100644 index 00000000..ae792bfe --- /dev/null +++ b/library/Rules/SubdivisionCode/BnSubdivisionCode.php @@ -0,0 +1,33 @@ + + * + * 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 Brunei subdivision code. + * + * ISO 3166-1 alpha-2: BN + * + * @link http://www.geonames.org/BN/administrative-division-brunei.html + */ +class BnSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'BE', // Belait + 'BM', // Brunei and Muara + 'TE', // Temburong + 'TU', // Tutong + ); + + public $compareIdentical = true; +}