mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 15:50:03 +01:00
The tool we used to verify whether the code base has the correct coding
standard was removed [1].
This commit will set up one that works best for us and will also make
sure we have fully compliant to PS1 and PSR2.
[1]: ffec95acda
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
112 lines
3.2 KiB
PHP
112 lines
3.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Respect/Validation.
|
|
*
|
|
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
|
|
*
|
|
* For the full copyright and license information, please view the "LICENSE.md"
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Rules\Locale;
|
|
|
|
use Respect\Validation\Rules\AbstractSearcher;
|
|
|
|
/**
|
|
* Validates whether an input is subdivision code of Morocco or not.
|
|
*
|
|
* ISO 3166-1 alpha-2: MA
|
|
*
|
|
* @see http://www.geonames.org/MA/administrative-division-morocco.html
|
|
*
|
|
* @author Henrique Moody <henriquemoody@gmail.com>
|
|
*/
|
|
final class MaSubdivisionCode extends AbstractSearcher
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function getDataSource(): array
|
|
{
|
|
return [
|
|
'01', // Tanger-Tetouan-Al Hoceima
|
|
'02', // Oriental
|
|
'03', // Fès-Meknès
|
|
'04', // Rabat-Salé-Kénitra
|
|
'05', // Béni Mellal-Khénifra
|
|
'06', // Casablanca-Settat
|
|
'07', // Marrakesh-Safi
|
|
'08', // Drâa-Tafilalet
|
|
'09', // Souss-Massa
|
|
'10', // Guelmim-Oued Noun
|
|
'11', // Laâyoune-Sakia El Hamra
|
|
'12', // Dakhla-Oued Ed-Dahab
|
|
'AGD', // Agadir-Ida-Outanane
|
|
'AOU', // Aousserd (EH)
|
|
'ASZ', // Assa-Zag
|
|
'AZI', // Azilal
|
|
'BEM', // Beni Mellal
|
|
'BER', // Berkane
|
|
'BES', // Ben Slimane
|
|
'BOD', // Boujdour (EH)
|
|
'BOM', // Boulemane
|
|
'CAS', // Casablanca [Dar el Beïda]
|
|
'CHE', // Chefchaouen
|
|
'CHI', // Chichaoua
|
|
'CHT', // Chtouka-Ait Baha
|
|
'ERR', // Errachidia
|
|
'ESI', // Essaouira
|
|
'ESM', // Es Smara (EH)
|
|
'FAH', // Fahs-Beni Makada
|
|
'FES', // Fès-Dar-Dbibegh
|
|
'FIG', // Figuig
|
|
'GUE', // Guelmim
|
|
'HAJ', // El Hajeb
|
|
'HAO', // Al Haouz
|
|
'HOC', // Al Hoceïma
|
|
'IFR', // Ifrane
|
|
'INE', // Inezgane-Ait Melloul
|
|
'JDI', // El Jadida
|
|
'JRA', // Jrada
|
|
'KEN', // Kénitra
|
|
'KES', // Kelaat es Sraghna
|
|
'KHE', // Khémisset
|
|
'KHN', // Khénifra
|
|
'KHO', // Khouribga
|
|
'LAA', // Laâyoune
|
|
'LAR', // Larache
|
|
'MED', // Médiouna
|
|
'MEK', // Meknès
|
|
'MMD', // Marrakech-Medina
|
|
'MMN', // Marrakech-Menara
|
|
'MOH', // Mohammadia
|
|
'MOU', // Moulay Yacoub
|
|
'NAD', // Nador
|
|
'NOU', // Nouaceur
|
|
'OUA', // Ouarzazate
|
|
'OUD', // Oued ed Dahab (EH)
|
|
'OUJ', // Oujda-Angad
|
|
'RAB', // Rabat
|
|
'SAF', // Safi
|
|
'SAL', // Salé
|
|
'SEF', // Sefrou
|
|
'SET', // Settat
|
|
'SIK', // Sidi Kacem
|
|
'SKH', // Skhirate-Témara
|
|
'SYB', // Sidi Youssef Ben Ali
|
|
'TAI', // Taourirt
|
|
'TAO', // Taounate
|
|
'TAR', // Taroudant
|
|
'TAT', // Tata
|
|
'TAZ', // Taza
|
|
'TET', // Tétouan
|
|
'TIZ', // Tiznit
|
|
'TNG', // Tanger-Assilah
|
|
'TNT', // Tan-Tan
|
|
'ZAG', // Zagora
|
|
];
|
|
}
|
|
}
|