diff --git a/library/Exceptions/SubdivisionCode/LuSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/LuSubdivisionCodeException.php new file mode 100644 index 00000000..31afb78c --- /dev/null +++ b/library/Exceptions/SubdivisionCode/LuSubdivisionCodeException.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 Luxembourg subdivision code. + * + * ISO 3166-1 alpha-2: LU + */ +class LuSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Luxembourg', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Luxembourg', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/LuSubdivisionCode.php b/library/Rules/SubdivisionCode/LuSubdivisionCode.php new file mode 100644 index 00000000..326a0f2d --- /dev/null +++ b/library/Rules/SubdivisionCode/LuSubdivisionCode.php @@ -0,0 +1,32 @@ + + * + * 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 Luxembourg subdivision code. + * + * ISO 3166-1 alpha-2: LU + * + * @link http://www.geonames.org/LU/administrative-division-luxembourg.html + */ +class LuSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'D', // Diekirch + 'G', // Grevenmacher + 'L', // Luxembourg + ); + + public $compareIdentical = true; +}