diff --git a/library/Exceptions/SubdivisionCode/LrSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/LrSubdivisionCodeException.php new file mode 100644 index 00000000..1d63a086 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/LrSubdivisionCodeException.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 Liberia subdivision code. + * + * ISO 3166-1 alpha-2: LR + */ +class LrSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Liberia', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Liberia', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/LrSubdivisionCode.php b/library/Rules/SubdivisionCode/LrSubdivisionCode.php new file mode 100644 index 00000000..ec381a58 --- /dev/null +++ b/library/Rules/SubdivisionCode/LrSubdivisionCode.php @@ -0,0 +1,42 @@ + + * + * 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 Liberia subdivision code. + * + * ISO 3166-1 alpha-2: LR + * + * @link http://www.geonames.org/LR/administrative-division-liberia.html + */ +class LrSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'BG', // Bong + 'BM', // Bomi + 'CM', // Grand Cape Mount + 'GB', // Grand Bassa + 'GG', // Grand Gedeh + 'GK', // Grand Kru + 'LO', // Lofa + 'MG', // Margibi + 'MO', // Montserrado + 'MY', // Maryland + 'NI', // Nimba + 'RI', // River Cess + 'SI', // Sinoe + ); + + public $compareIdentical = true; +}