diff --git a/library/Exceptions/SubdivisionCode/FmSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/FmSubdivisionCodeException.php new file mode 100644 index 00000000..0a14aea6 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/FmSubdivisionCodeException.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 Micronesia subdivision code. + * + * ISO 3166-1 alpha-2: FM + */ +class FmSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Micronesia', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Micronesia', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/FmSubdivisionCode.php b/library/Rules/SubdivisionCode/FmSubdivisionCode.php new file mode 100644 index 00000000..a4292e79 --- /dev/null +++ b/library/Rules/SubdivisionCode/FmSubdivisionCode.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 Micronesia subdivision code. + * + * ISO 3166-1 alpha-2: FM + * + * @link http://www.geonames.org/FM/administrative-division-micronesia.html + */ +class FmSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'KSA', // Kosrae + 'PNI', // Pohnpei + 'TRK', // Chuuk + 'YAP', // Yap + ); + + public $compareIdentical = true; +}