diff --git a/library/Exceptions/SubdivisionCode/LcSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/LcSubdivisionCodeException.php new file mode 100644 index 00000000..cd9b4f46 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/LcSubdivisionCodeException.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 Saint Lucia subdivision code. + * + * ISO 3166-1 alpha-2: LC + */ +class LcSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Saint Lucia', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Saint Lucia', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/LcSubdivisionCode.php b/library/Rules/SubdivisionCode/LcSubdivisionCode.php new file mode 100644 index 00000000..3de67237 --- /dev/null +++ b/library/Rules/SubdivisionCode/LcSubdivisionCode.php @@ -0,0 +1,40 @@ + + * + * 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 Saint Lucia subdivision code. + * + * ISO 3166-1 alpha-2: LC + * + * @link http://www.geonames.org/LC/administrative-division-saint-lucia.html + */ +class LcSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'AR', // Anse-la-Raye + 'CA', // Castries + 'CH', // Choiseul + 'DA', // Dauphin + 'DE', // Dennery + 'GI', // Gros-Islet + 'LA', // Laborie + 'MI', // Micoud + 'PR', // Praslin + 'SO', // Soufriere + 'VF', // Vieux-Fort + ); + + public $compareIdentical = true; +}