From b27d96a4e9487a27b12e2df39a1af418b9b3955f Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Mon, 1 Jul 2013 14:54:02 +0200 Subject: [PATCH] Fix coding standards (using php-cs-fixer) --- src/Faker/ORM/Doctrine/EntityPopulator.php | 5 +- src/Faker/ORM/Doctrine/Populator.php | 2 +- src/Faker/Provider/Base.php | 14 +- src/Faker/Provider/Color.php | 181 +-- src/Faker/Provider/File.php | 1108 ++++++++--------- src/Faker/Provider/Internet.php | 6 +- src/Faker/Provider/Miscellaneous.php | 58 +- src/Faker/Provider/en_CA/Address.php | 4 - src/Faker/Provider/fr_BE/Address.php | 30 +- src/Faker/Provider/fr_BE/Person.php | 50 +- src/Faker/Provider/fr_FR/Company.php | 54 +- src/Faker/Provider/hy_AM/Address.php | 217 ++-- src/Faker/Provider/hy_AM/Company.php | 80 +- src/Faker/Provider/hy_AM/Internet.php | 57 +- src/Faker/Provider/hy_AM/Person.php | 122 +- src/Faker/Provider/hy_AM/PhoneNumber.php | 60 +- src/Faker/Provider/is_IS/Person.php | 15 +- src/Faker/Provider/nl_NL/Person.php | 6 +- src/Faker/Provider/ru_RU/Address.php | 2 +- src/Faker/Provider/ru_RU/Person.php | 2 +- src/Faker/Provider/ua_UA/Address.php | 1 + src/Faker/Provider/ua_UA/Company.php | 1 + src/Faker/Provider/ua_UA/Internet.php | 2 + src/Faker/Provider/ua_UA/Transliteration.php | 8 +- .../Framework/Constraint/IsValidSiren.php | 22 +- .../Constraint/IsValidSirenSiret.php | 56 +- .../Framework/Constraint/IsValidSiret.php | 22 +- test/Faker/Provider/BaseTest.php | 8 +- test/Faker/Provider/ColorTest.php | 38 +- test/Faker/Provider/ProviderOverrideTest.php | 2 +- test/Faker/Provider/fr_FR/CompanyTest.php | 16 +- 31 files changed, 1126 insertions(+), 1123 deletions(-) diff --git a/src/Faker/ORM/Doctrine/EntityPopulator.php b/src/Faker/ORM/Doctrine/EntityPopulator.php index 1fa2f3d5..6269bf12 100644 --- a/src/Faker/ORM/Doctrine/EntityPopulator.php +++ b/src/Faker/ORM/Doctrine/EntityPopulator.php @@ -114,9 +114,10 @@ class EntityPopulator $formatters[$assocName] = function($inserted) use ($relatedClass, &$index, $unique) { if ($unique && isset($inserted[$relatedClass])) { return $inserted[$relatedClass][$index++]; - } else if (isset($inserted[$relatedClass])) { + } elseif (isset($inserted[$relatedClass])) { return $inserted[$relatedClass][mt_rand(0, count($inserted[$relatedClass]) - 1)]; } + return null; }; } @@ -177,7 +178,7 @@ class EntityPopulator $id = null; do { $id = rand(); - } while(in_array($id, $ids)); + } while (in_array($id, $ids)); return $id; } diff --git a/src/Faker/ORM/Doctrine/Populator.php b/src/Faker/ORM/Doctrine/Populator.php index b1877216..957450ee 100644 --- a/src/Faker/ORM/Doctrine/Populator.php +++ b/src/Faker/ORM/Doctrine/Populator.php @@ -31,7 +31,7 @@ class Populator public function addEntity($entity, $number, $customColumnFormatters = array(), $customModifiers = array(), $generateId = false) { if (!$entity instanceof \Faker\ORM\Doctrine\EntityPopulator) { - if (null === $this->manager) { + if (null === $this->manager) { throw new \InvalidArgumentException("No entity manager passed to Doctrine Populator."); } $entity = new \Faker\ORM\Doctrine\EntityPopulator($this->manager->getClassMetadata($entity)); diff --git a/src/Faker/Provider/Base.php b/src/Faker/Provider/Base.php index cbccfc25..6f51e04f 100644 --- a/src/Faker/Provider/Base.php +++ b/src/Faker/Provider/Base.php @@ -65,12 +65,12 @@ class Base /** * Return a random float number - * - * @param int $nbMaxDecimals + * + * @param int $nbMaxDecimals * @param int|float $min * @param int|float $max * @example 48.8932 - * + * * @return float */ public static function randomFloat($nbMaxDecimals = null, $min = 0, $max = null) @@ -78,20 +78,20 @@ class Base if (null === $nbMaxDecimals) { $nbMaxDecimals = static::randomDigit(); } - + if (null === $max) { $max = static::randomNumber(); } - + if ($min > $max) { $tmp = $min; $min = $max; $max = $tmp; } - + return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); } - + /** * Returns a random number between $from and $to * diff --git a/src/Faker/Provider/Color.php b/src/Faker/Provider/Color.php index 03c45809..3b3b22da 100644 --- a/src/Faker/Provider/Color.php +++ b/src/Faker/Provider/Color.php @@ -7,105 +7,106 @@ namespace Faker\Provider; - class Color extends Base { - protected static $safeColorNames = array( - 'black', 'maroon', 'green', 'navy', 'olive', - 'purple', 'teal', 'lime', 'blue', 'silver', - 'gray', 'yellow', 'fuchsia', 'aqua', 'white' - ); + protected static $safeColorNames = array( + 'black', 'maroon', 'green', 'navy', 'olive', + 'purple', 'teal', 'lime', 'blue', 'silver', + 'gray', 'yellow', 'fuchsia', 'aqua', 'white' + ); - protected static $allColorNames = array( - 'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', - 'Azure', 'Beige', 'Bisque', 'Black', 'BlanchedAlmond', - 'Blue', 'BlueViolet', 'Brown', 'BurlyWood', 'CadetBlue', - 'Chartreuse', 'Chocolate', 'Coral', 'CornflowerBlue', - 'Cornsilk', 'Crimson', 'Cyan', 'DarkBlue', 'DarkCyan', - 'DarkGoldenRod', 'DarkGray', 'DarkGreen', 'DarkKhaki', - 'DarkMagenta', 'DarkOliveGreen', 'Darkorange', 'DarkOrchid', - 'DarkRed', 'DarkSalmon', 'DarkSeaGreen', 'DarkSlateBlue', - 'DarkSlateGray', 'DarkTurquoise', 'DarkViolet', 'DeepPink', - 'DeepSkyBlue', 'DimGray', 'DimGrey', 'DodgerBlue', 'FireBrick', - 'FloralWhite', 'ForestGreen', 'Fuchsia', 'Gainsboro', 'GhostWhite', - 'Gold', 'GoldenRod', 'Gray', 'Green', 'GreenYellow', 'HoneyDew', - 'HotPink', 'IndianRed ', 'Indigo ', 'Ivory', 'Khaki', 'Lavender', - 'LavenderBlush', 'LawnGreen', 'LemonChiffon', 'LightBlue', 'LightCoral', - 'LightCyan', 'LightGoldenRodYellow', 'LightGray', 'LightGreen', 'LightPink', - 'LightSalmon', 'LightSeaGreen', 'LightSkyBlue', 'LightSlateGray', 'LightSteelBlue', - 'LightYellow', 'Lime', 'LimeGreen', 'Linen', 'Magenta', 'Maroon', 'MediumAquaMarine', - 'MediumBlue', 'MediumOrchid', 'MediumPurple', 'MediumSeaGreen', 'MediumSlateBlue', - 'MediumSpringGreen', 'MediumTurquoise', 'MediumVioletRed', 'MidnightBlue', - 'MintCream', 'MistyRose', 'Moccasin', 'NavajoWhite', 'Navy', 'OldLace', 'Olive', - 'OliveDrab', 'Orange', 'OrangeRed', 'Orchid', 'PaleGoldenRod', 'PaleGreen', - 'PaleTurquoise', 'PaleVioletRed', 'PapayaWhip', 'PeachPuff', 'Peru', 'Pink', 'Plum', - 'PowderBlue', 'Purple', 'Red', 'RosyBrown', 'RoyalBlue', 'SaddleBrown', 'Salmon', - 'SandyBrown', 'SeaGreen', 'SeaShell', 'Sienna', 'Silver', 'SkyBlue', 'SlateBlue', - 'SlateGray', 'Snow', 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato', - 'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow', 'YellowGreen' - ); + protected static $allColorNames = array( + 'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', + 'Azure', 'Beige', 'Bisque', 'Black', 'BlanchedAlmond', + 'Blue', 'BlueViolet', 'Brown', 'BurlyWood', 'CadetBlue', + 'Chartreuse', 'Chocolate', 'Coral', 'CornflowerBlue', + 'Cornsilk', 'Crimson', 'Cyan', 'DarkBlue', 'DarkCyan', + 'DarkGoldenRod', 'DarkGray', 'DarkGreen', 'DarkKhaki', + 'DarkMagenta', 'DarkOliveGreen', 'Darkorange', 'DarkOrchid', + 'DarkRed', 'DarkSalmon', 'DarkSeaGreen', 'DarkSlateBlue', + 'DarkSlateGray', 'DarkTurquoise', 'DarkViolet', 'DeepPink', + 'DeepSkyBlue', 'DimGray', 'DimGrey', 'DodgerBlue', 'FireBrick', + 'FloralWhite', 'ForestGreen', 'Fuchsia', 'Gainsboro', 'GhostWhite', + 'Gold', 'GoldenRod', 'Gray', 'Green', 'GreenYellow', 'HoneyDew', + 'HotPink', 'IndianRed ', 'Indigo ', 'Ivory', 'Khaki', 'Lavender', + 'LavenderBlush', 'LawnGreen', 'LemonChiffon', 'LightBlue', 'LightCoral', + 'LightCyan', 'LightGoldenRodYellow', 'LightGray', 'LightGreen', 'LightPink', + 'LightSalmon', 'LightSeaGreen', 'LightSkyBlue', 'LightSlateGray', 'LightSteelBlue', + 'LightYellow', 'Lime', 'LimeGreen', 'Linen', 'Magenta', 'Maroon', 'MediumAquaMarine', + 'MediumBlue', 'MediumOrchid', 'MediumPurple', 'MediumSeaGreen', 'MediumSlateBlue', + 'MediumSpringGreen', 'MediumTurquoise', 'MediumVioletRed', 'MidnightBlue', + 'MintCream', 'MistyRose', 'Moccasin', 'NavajoWhite', 'Navy', 'OldLace', 'Olive', + 'OliveDrab', 'Orange', 'OrangeRed', 'Orchid', 'PaleGoldenRod', 'PaleGreen', + 'PaleTurquoise', 'PaleVioletRed', 'PapayaWhip', 'PeachPuff', 'Peru', 'Pink', 'Plum', + 'PowderBlue', 'Purple', 'Red', 'RosyBrown', 'RoyalBlue', 'SaddleBrown', 'Salmon', + 'SandyBrown', 'SeaGreen', 'SeaShell', 'Sienna', 'Silver', 'SkyBlue', 'SlateBlue', + 'SlateGray', 'Snow', 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato', + 'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow', 'YellowGreen' + ); - /** - * @example '#fa3cc2' - */ - public static function hexColor() - { - return '#' . dechex(mt_rand(1, 16777215)); - } + /** + * @example '#fa3cc2' + */ + public static function hexColor() + { + return '#' . dechex(mt_rand(1, 16777215)); + } - /** - * @example '#ff0044' - */ - public static function safeHexColor() - { - $color = str_pad(dechex(mt_rand(0,255)), 3, '0', STR_PAD_LEFT); - return '#' . $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2]; - } + /** + * @example '#ff0044' + */ + public static function safeHexColor() + { + $color = str_pad(dechex(mt_rand(0,255)), 3, '0', STR_PAD_LEFT); - /** - * @example 'array(0,255,122)' - */ - public static function rgbColorAsArray() - { - $color = static::hexColor(); - return array( - hexdec(substr($color,1,2)), - hexdec(substr($color,3,2)), - hexdec(substr($color,5,2)) - ); - } + return '#' . $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2]; + } - /** - * @example '0,255,122' - */ - public static function rgbColor() - { - return implode(',', static::rgbColorAsArray()); - } + /** + * @example 'array(0,255,122)' + */ + public static function rgbColorAsArray() + { + $color = static::hexColor(); - /** - * @example 'rgb(0,255,122)' - */ - public static function rgbCssColor() - { - return 'rgb(' . static::rgbColor() . ')'; - } + return array( + hexdec(substr($color,1,2)), + hexdec(substr($color,3,2)), + hexdec(substr($color,5,2)) + ); + } - /** - * @example 'blue' - */ - public static function safeColorName() - { - return static::randomElement(static::$safeColorNames); - } + /** + * @example '0,255,122' + */ + public static function rgbColor() + { + return implode(',', static::rgbColorAsArray()); + } - /** - * @example 'NavajoWhite' - */ - public static function colorName() - { - return static::randomElement(static::$allColorNames); - } + /** + * @example 'rgb(0,255,122)' + */ + public static function rgbCssColor() + { + return 'rgb(' . static::rgbColor() . ')'; + } -} \ No newline at end of file + /** + * @example 'blue' + */ + public static function safeColorName() + { + return static::randomElement(static::$safeColorNames); + } + + /** + * @example 'NavajoWhite' + */ + public static function colorName() + { + return static::randomElement(static::$allColorNames); + } + +} diff --git a/src/Faker/Provider/File.php b/src/Faker/Provider/File.php index f492bdc7..671ccb2d 100644 --- a/src/Faker/Provider/File.php +++ b/src/Faker/Provider/File.php @@ -4,560 +4,560 @@ namespace Faker\Provider; class File extends \Faker\Provider\Base { - /** - * MIME types from the apache.org file. Some types are truncated. - * - * @var array Map of MIME types => file extension(s) - * @link http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - */ - protected static $mimeTypes = array( - 'application/atom+xml' => 'atom', - 'application/ecmascript' => 'ecma', - 'application/emma+xml' => 'emma', - 'application/epub+zip' => 'epub', - 'application/java-archive' => 'jar', - 'application/java-vm' => 'class', - 'application/javascript' => 'js', - 'application/json' => 'json', - 'application/jsonml+json' => 'jsonml', - 'application/lost+xml' => 'lostxml', - 'application/mathml+xml' => 'mathml', - 'application/mets+xml' => 'mets', - 'application/mods+xml' => 'mods', - 'application/mp4' => 'mp4s', - 'application/msword' => array('doc', 'dot'), - 'application/octet-stream' => array( - 'bin', - 'dms', - 'lrf', - 'mar', - 'so', - 'dist', - 'distz', - 'pkg', - 'bpk', - 'dump', - 'elc', - 'deploy' - ), - 'application/ogg' => 'ogx', - 'application/omdoc+xml' => 'omdoc', - 'application/pdf' => 'pdf', - 'application/pgp-encrypted' => 'pgp', - 'application/pgp-signature' => array('asc', 'sig'), - 'application/pkix-pkipath' => 'pkipath', - 'application/pkixcmp' => 'pki', - 'application/pls+xml' => 'pls', - 'application/postscript' => array('ai', 'eps', 'ps'), - 'application/pskc+xml' => 'pskcxml', - 'application/rdf+xml' => 'rdf', - 'application/reginfo+xml' => 'rif', - 'application/rss+xml' => 'rss', - 'application/rtf' => 'rtf', - 'application/sbml+xml' => 'sbml', - 'application/vnd.adobe.air-application-installer-package+zip' => 'air', - 'application/vnd.adobe.xdp+xml' => 'xdp', - 'application/vnd.adobe.xfdf' => 'xfdf', - 'application/vnd.ahead.space' => 'ahead', - 'application/vnd.dart' => 'dart', - 'application/vnd.data-vision.rdz' => 'rdz', - 'application/vnd.dece.data' => array('uvf', 'uvvf', 'uvd', 'uvvd'), - 'application/vnd.dece.ttml+xml' => array('uvt', 'uvvt'), - 'application/vnd.dece.unspecified' => array('uvx', 'uvvx'), - 'application/vnd.dece.zip' => array('uvz', 'uvvz'), - 'application/vnd.denovo.fcselayout-link' => 'fe_launch', - 'application/vnd.dna' => 'dna', - 'application/vnd.dolby.mlp' => 'mlp', - 'application/vnd.dpgraph' => 'dpg', - 'application/vnd.dreamfactory' => 'dfac', - 'application/vnd.ds-keypoint' => 'kpxx', - 'application/vnd.dvb.ait' => 'ait', - 'application/vnd.dvb.service' => 'svc', - 'application/vnd.dynageo' => 'geo', - 'application/vnd.ecowin.chart' => 'mag', - 'application/vnd.enliven' => 'nml', - 'application/vnd.epson.esf' => 'esf', - 'application/vnd.epson.msf' => 'msf', - 'application/vnd.epson.quickanime' => 'qam', - 'application/vnd.epson.salt' => 'slt', - 'application/vnd.epson.ssf' => 'ssf', - 'application/vnd.ezpix-album' => 'ez2', - 'application/vnd.ezpix-package' => 'ez3', - 'application/vnd.fdf' => 'fdf', - 'application/vnd.fdsn.mseed' => 'mseed', - 'application/vnd.fdsn.seed' => array('seed', 'dataless'), - 'application/vnd.flographit' => 'gph', - 'application/vnd.fluxtime.clip' => 'ftc', - 'application/vnd.hal+xml' => 'hal', - 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', - 'application/vnd.ibm.minipay' => 'mpy', - 'application/vnd.ibm.secure-container' => 'sc', - 'application/vnd.iccprofile' => array('icc', 'icm'), - 'application/vnd.igloader' => 'igl', - 'application/vnd.immervision-ivp' => 'ivp', - 'application/vnd.kde.karbon' => 'karbon', - 'application/vnd.kde.kchart' => 'chrt', - 'application/vnd.kde.kformula' => 'kfo', - 'application/vnd.kde.kivio' => 'flw', - 'application/vnd.kde.kontour' => 'kon', - 'application/vnd.kde.kpresenter' => array('kpr', 'kpt'), - 'application/vnd.kde.kspread' => 'ksp', - 'application/vnd.kde.kword' => array('kwd', 'kwt'), - 'application/vnd.kenameaapp' => 'htke', - 'application/vnd.kidspiration' => 'kia', - 'application/vnd.kinar' => array('kne', 'knp'), - 'application/vnd.koan' => array('skp', 'skd', 'skt', 'skm'), - 'application/vnd.kodak-descriptor' => 'sse', - 'application/vnd.las.las+xml' => 'lasxml', - 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', - 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', - 'application/vnd.lotus-1-2-3' => '123', - 'application/vnd.lotus-approach' => 'apr', - 'application/vnd.lotus-freelance' => 'pre', - 'application/vnd.lotus-notes' => 'nsf', - 'application/vnd.lotus-organizer' => 'org', - 'application/vnd.lotus-screencam' => 'scm', - 'application/vnd.mozilla.xul+xml' => 'xul', - 'application/vnd.ms-artgalry' => 'cil', - 'application/vnd.ms-cab-compressed' => 'cab', - 'application/vnd.ms-excel' => array( - 'xls', - 'xlm', - 'xla', - 'xlc', - 'xlt', - 'xlw' - ), - 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', - 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', - 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', - 'application/vnd.ms-fontobject' => 'eot', - 'application/vnd.ms-htmlhelp' => 'chm', - 'application/vnd.ms-ims' => 'ims', - 'application/vnd.ms-lrm' => 'lrm', - 'application/vnd.ms-officetheme' => 'thmx', - 'application/vnd.ms-pki.seccat' => 'cat', - 'application/vnd.ms-pki.stl' => 'stl', - 'application/vnd.ms-powerpoint' => array('ppt', 'pps', 'pot'), - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', - 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', - 'application/vnd.ms-project' => array('mpp', 'mpt'), - 'application/vnd.ms-word.document.macroenabled.12' => 'docm', - 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', - 'application/vnd.ms-works' => array('wps', 'wks', 'wcm', 'wdb'), - 'application/vnd.ms-wpl' => 'wpl', - 'application/vnd.ms-xpsdocument' => 'xps', - 'application/vnd.mseq' => 'mseq', - 'application/vnd.musician' => 'mus', - 'application/vnd.oasis.opendocument.chart' => 'odc', - 'application/vnd.oasis.opendocument.chart-template' => 'otc', - 'application/vnd.oasis.opendocument.database' => 'odb', - 'application/vnd.oasis.opendocument.formula' => 'odf', - 'application/vnd.oasis.opendocument.formula-template' => 'odft', - 'application/vnd.oasis.opendocument.graphics' => 'odg', - 'application/vnd.oasis.opendocument.graphics-template' => 'otg', - 'application/vnd.oasis.opendocument.image' => 'odi', - 'application/vnd.oasis.opendocument.image-template' => 'oti', - 'application/vnd.oasis.opendocument.presentation' => 'odp', - 'application/vnd.oasis.opendocument.presentation-template' => 'otp', - 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', - 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', - 'application/vnd.oasis.opendocument.text' => 'odt', - 'application/vnd.oasis.opendocument.text-master' => 'odm', - 'application/vnd.oasis.opendocument.text-template' => 'ott', - 'application/vnd.oasis.opendocument.text-web' => 'oth', - 'application/vnd.olpc-sugar' => 'xo', - 'application/vnd.oma.dd2+xml' => 'dd2', - 'application/vnd.openofficeorg.extension' => 'oxt', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', - 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', - 'application/vnd.pvi.ptid1' => 'ptid', - 'application/vnd.quark.quarkxpress' => array( - 'qxd', - 'qxt', - 'qwd', - 'qwt', - 'qxl', - 'qxb' - ), - 'application/vnd.realvnc.bed' => 'bed', - 'application/vnd.recordare.musicxml' => 'mxl', - 'application/vnd.recordare.musicxml+xml' => 'musicxml', - 'application/vnd.rig.cryptonote' => 'cryptonote', - 'application/vnd.rim.cod' => 'cod', - 'application/vnd.rn-realmedia' => 'rm', - 'application/vnd.rn-realmedia-vbr' => 'rmvb', - 'application/vnd.route66.link66+xml' => 'link66', - 'application/vnd.sailingtracker.track' => 'st', - 'application/vnd.seemail' => 'see', - 'application/vnd.sema' => 'sema', - 'application/vnd.semd' => 'semd', - 'application/vnd.semf' => 'semf', - 'application/vnd.shana.informed.formdata' => 'ifm', - 'application/vnd.shana.informed.formtemplate' => 'itp', - 'application/vnd.shana.informed.interchange' => 'iif', - 'application/vnd.shana.informed.package' => 'ipk', - 'application/vnd.simtech-mindmapper' => array('twd', 'twds'), - 'application/vnd.smaf' => 'mmf', - 'application/vnd.stepmania.stepchart' => 'sm', - 'application/vnd.sun.xml.calc' => 'sxc', - 'application/vnd.sun.xml.calc.template' => 'stc', - 'application/vnd.sun.xml.draw' => 'sxd', - 'application/vnd.sun.xml.draw.template' => 'std', - 'application/vnd.sun.xml.impress' => 'sxi', - 'application/vnd.sun.xml.impress.template' => 'sti', - 'application/vnd.sun.xml.math' => 'sxm', - 'application/vnd.sun.xml.writer' => 'sxw', - 'application/vnd.sun.xml.writer.global' => 'sxg', - 'application/vnd.sun.xml.writer.template' => 'stw', - 'application/vnd.sus-calendar' => array('sus', 'susp'), - 'application/vnd.svd' => 'svd', - 'application/vnd.symbian.install' => array('sis', 'sisx'), - 'application/vnd.syncml+xml' => 'xsm', - 'application/vnd.syncml.dm+wbxml' => 'bdm', - 'application/vnd.syncml.dm+xml' => 'xdm', - 'application/vnd.tao.intent-module-archive' => 'tao', - 'application/vnd.tcpdump.pcap' => array('pcap', 'cap', 'dmp'), - 'application/vnd.tmobile-livetv' => 'tmo', - 'application/vnd.trid.tpt' => 'tpt', - 'application/vnd.triscape.mxs' => 'mxs', - 'application/vnd.trueapp' => 'tra', - 'application/vnd.ufdl' => array('ufd', 'ufdl'), - 'application/vnd.uiq.theme' => 'utz', - 'application/vnd.umajin' => 'umj', - 'application/vnd.unity' => 'unityweb', - 'application/vnd.uoml+xml' => 'uoml', - 'application/vnd.vcx' => 'vcx', - 'application/vnd.visio' => array('vsd', 'vst', 'vss', 'vsw'), - 'application/vnd.visionary' => 'vis', - 'application/vnd.vsf' => 'vsf', - 'application/vnd.wap.wbxml' => 'wbxml', - 'application/vnd.wap.wmlc' => 'wmlc', - 'application/vnd.wap.wmlscriptc' => 'wmlsc', - 'application/vnd.webturbo' => 'wtb', - 'application/vnd.wolfram.player' => 'nbp', - 'application/vnd.wordperfect' => 'wpd', - 'application/vnd.wqd' => 'wqd', - 'application/vnd.wt.stf' => 'stf', - 'application/vnd.xara' => 'xar', - 'application/vnd.xfdl' => 'xfdl', - 'application/voicexml+xml' => 'vxml', - 'application/widget' => 'wgt', - 'application/winhlp' => 'hlp', - 'application/wsdl+xml' => 'wsdl', - 'application/wspolicy+xml' => 'wspolicy', - 'application/x-7z-compressed' => '7z', - 'application/x-bittorrent' => 'torrent', - 'application/x-blorb' => array('blb', 'blorb'), - 'application/x-bzip' => 'bz', - 'application/x-cdlink' => 'vcd', - 'application/x-cfs-compressed' => 'cfs', - 'application/x-chat' => 'chat', - 'application/x-chess-pgn' => 'pgn', - 'application/x-conference' => 'nsc', - 'application/x-cpio' => 'cpio', - 'application/x-csh' => 'csh', - 'application/x-debian-package' => array('deb', 'udeb'), - 'application/x-dgc-compressed' => 'dgc', - 'application/x-director' => array( - 'dir', - 'dcr', - 'dxr', - 'cst', - 'cct', - 'cxt', - 'w3d', - 'fgd', - 'swa' - ), - 'application/x-font-ttf' => array('ttf', 'ttc'), - 'application/x-font-type1' => array('pfa', 'pfb', 'pfm', 'afm'), - 'application/x-font-woff' => 'woff', - 'application/x-freearc' => 'arc', - 'application/x-futuresplash' => 'spl', - 'application/x-gca-compressed' => 'gca', - 'application/x-glulx' => 'ulx', - 'application/x-gnumeric' => 'gnumeric', - 'application/x-gramps-xml' => 'gramps', - 'application/x-gtar' => 'gtar', - 'application/x-hdf' => 'hdf', - 'application/x-install-instructions' => 'install', - 'application/x-iso9660-image' => 'iso', - 'application/x-java-jnlp-file' => 'jnlp', - 'application/x-latex' => 'latex', - 'application/x-lzh-compressed' => array('lzh', 'lha'), - 'application/x-mie' => 'mie', - 'application/x-mobipocket-ebook' => array('prc', 'mobi'), - 'application/x-ms-application' => 'application', - 'application/x-ms-shortcut' => 'lnk', - 'application/x-ms-wmd' => 'wmd', - 'application/x-ms-wmz' => 'wmz', - 'application/x-ms-xbap' => 'xbap', - 'application/x-msaccess' => 'mdb', - 'application/x-msbinder' => 'obd', - 'application/x-mscardfile' => 'crd', - 'application/x-msclip' => 'clp', - 'application/x-msdownload' => array('exe', 'dll', 'com', 'bat', 'msi'), - 'application/x-msmediaview' => array( - 'mvb', - 'm13', - 'm14' - ), - 'application/x-msmetafile' => array('wmf', 'wmz', 'emf', 'emz'), - 'application/x-rar-compressed' => 'rar', - 'application/x-research-info-systems' => 'ris', - 'application/x-sh' => 'sh', - 'application/x-shar' => 'shar', - 'application/x-shockwave-flash' => 'swf', - 'application/x-silverlight-app' => 'xap', - 'application/x-sql' => 'sql', - 'application/x-stuffit' => 'sit', - 'application/x-stuffitx' => 'sitx', - 'application/x-subrip' => 'srt', - 'application/x-sv4cpio' => 'sv4cpio', - 'application/x-sv4crc' => 'sv4crc', - 'application/x-t3vm-image' => 't3', - 'application/x-tads' => 'gam', - 'application/x-tar' => 'tar', - 'application/x-tcl' => 'tcl', - 'application/x-tex' => 'tex', - 'application/x-tex-tfm' => 'tfm', - 'application/x-texinfo' => array('texinfo', 'texi'), - 'application/x-tgif' => 'obj', - 'application/x-ustar' => 'ustar', - 'application/x-wais-source' => 'src', - 'application/x-x509-ca-cert' => array('der', 'crt'), - 'application/x-xfig' => 'fig', - 'application/x-xliff+xml' => 'xlf', - 'application/x-xpinstall' => 'xpi', - 'application/x-xz' => 'xz', - 'application/x-zmachine' => 'z1', - 'application/xaml+xml' => 'xaml', - 'application/xcap-diff+xml' => 'xdf', - 'application/xenc+xml' => 'xenc', - 'application/xhtml+xml' => array('xhtml', 'xht'), - 'application/xml' => array('xml', 'xsl'), - 'application/xml-dtd' => 'dtd', - 'application/xop+xml' => 'xop', - 'application/xproc+xml' => 'xpl', - 'application/xslt+xml' => 'xslt', - 'application/xspf+xml' => 'xspf', - 'application/xv+xml' => array('mxml', 'xhvml', 'xvml', 'xvm'), - 'application/yang' => 'yang', - 'application/yin+xml' => 'yin', - 'application/zip' => 'zip', - 'audio/adpcm' => 'adp', - 'audio/basic' => array('au', 'snd'), - 'audio/midi' => array('mid', 'midi', 'kar', 'rmi'), - 'audio/mp4' => 'mp4a', - 'audio/mpeg' => array( - 'mpga', - 'mp2', - 'mp2a', - 'mp3', - 'm2a', - 'm3a' - ), - 'audio/ogg' => array('oga', 'ogg', 'spx'), - 'audio/vnd.dece.audio' => array('uva', 'uvva'), - 'audio/vnd.rip' => 'rip', - 'audio/webm' => 'weba', - 'audio/x-aac' => 'aac', - 'audio/x-aiff' => array('aif', 'aiff', 'aifc'), - 'audio/x-caf' => 'caf', - 'audio/x-flac' => 'flac', - 'audio/x-matroska' => 'mka', - 'audio/x-mpegurl' => 'm3u', - 'audio/x-ms-wax' => 'wax', - 'audio/x-ms-wma' => 'wma', - 'audio/x-pn-realaudio' => array('ram', 'ra'), - 'audio/x-pn-realaudio-plugin' => 'rmp', - 'audio/x-wav' => 'wav', - 'audio/xm' => 'xm', - 'image/bmp' => 'bmp', - 'image/cgm' => 'cgm', - 'image/g3fax' => 'g3', - 'image/gif' => 'gif', - 'image/ief' => 'ief', - 'image/jpeg' => array('jpeg', 'jpg', 'jpe'), - 'image/ktx' => 'ktx', - 'image/png' => 'png', - 'image/prs.btif' => 'btif', - 'image/sgi' => 'sgi', - 'image/svg+xml' => array('svg', 'svgz'), - 'image/tiff' => array('tiff', 'tif'), - 'image/vnd.adobe.photoshop' => 'psd', - 'image/vnd.dece.graphic' => array('uvi', 'uvvi', 'uvg', 'uvvg'), - 'image/vnd.dvb.subtitle' => 'sub', - 'image/vnd.djvu' => array('djvu', 'djv'), - 'image/vnd.dwg' => 'dwg', - 'image/vnd.dxf' => 'dxf', - 'image/vnd.fastbidsheet' => 'fbs', - 'image/vnd.fpx' => 'fpx', - 'image/vnd.fst' => 'fst', - 'image/vnd.fujixerox.edmics-mmr' => 'mmr', - 'image/vnd.fujixerox.edmics-rlc' => 'rlc', - 'image/vnd.ms-modi' => 'mdi', - 'image/vnd.ms-photo' => 'wdp', - 'image/vnd.net-fpx' => 'npx', - 'image/vnd.wap.wbmp' => 'wbmp', - 'image/vnd.xiff' => 'xif', - 'image/webp' => 'webp', - 'image/x-3ds' => '3ds', - 'image/x-cmu-raster' => 'ras', - 'image/x-cmx' => 'cmx', - 'image/x-freehand' => array('fh', 'fhc', 'fh4', 'fh5', 'fh7'), - 'image/x-icon' => 'ico', - 'image/x-mrsid-image' => 'sid', - 'image/x-pcx' => 'pcx', - 'image/x-pict' => array('pic', 'pct'), - 'image/x-portable-anymap' => 'pnm', - 'image/x-portable-bitmap' => 'pbm', - 'image/x-portable-graymap' => 'pgm', - 'image/x-portable-pixmap' => 'ppm', - 'image/x-rgb' => 'rgb', - 'image/x-tga' => 'tga', - 'image/x-xbitmap' => 'xbm', - 'image/x-xpixmap' => 'xpm', - 'image/x-xwindowdump' => 'xwd', - 'message/rfc822' => array('eml', 'mime'), - 'model/iges' => array('igs', 'iges'), - 'model/mesh' => array('msh', 'mesh', 'silo'), - 'model/vnd.collada+xml' => 'dae', - 'model/vnd.dwf' => 'dwf', - 'model/vnd.gdl' => 'gdl', - 'model/vnd.gtw' => 'gtw', - 'model/vnd.mts' => 'mts', - 'model/vnd.vtu' => 'vtu', - 'model/vrml' => array('wrl', 'vrml'), - 'model/x3d+binary' => 'x3db', - 'model/x3d+vrml' => 'x3dv', - 'model/x3d+xml' => 'x3d', - 'text/cache-manifest' => 'appcache', - 'text/calendar' => array('ics', 'ifb'), - 'text/css' => 'css', - 'text/csv' => 'csv', - 'text/html' => array('html', 'htm'), - 'text/n3' => 'n3', - 'text/plain' => array( - 'txt', - 'text', - 'conf', - 'def', - 'list', - 'log', - 'in' - ), - 'text/prs.lines.tag' => 'dsc', - 'text/richtext' => 'rtx', - 'text/sgml' => array('sgml', 'sgm'), - 'text/tab-separated-values' => 'tsv', - 'text/troff' => array( - 't', - 'tr', - 'roff', - 'man', - 'me', - 'ms' - ), - 'text/turtle' => 'ttl', - 'text/uri-list' => array('uri', 'uris', 'urls'), - 'text/vcard' => 'vcard', - 'text/vnd.curl' => 'curl', - 'text/vnd.curl.dcurl' => 'dcurl', - 'text/vnd.curl.scurl' => 'scurl', - 'text/vnd.curl.mcurl' => 'mcurl', - 'text/vnd.dvb.subtitle' => 'sub', - 'text/vnd.fly' => 'fly', - 'text/vnd.fmi.flexstor' => 'flx', - 'text/vnd.graphviz' => 'gv', - 'text/vnd.in3d.3dml' => '3dml', - 'text/vnd.in3d.spot' => 'spot', - 'text/vnd.sun.j2me.app-descriptor' => 'jad', - 'text/vnd.wap.wml' => 'wml', - 'text/vnd.wap.wmlscript' => 'wmls', - 'text/x-asm' => array('s', 'asm'), - 'text/x-fortran' => array('f', 'for', 'f77', 'f90'), - 'text/x-java-source' => 'java', - 'text/x-opml' => 'opml', - 'text/x-pascal' => array('p', 'pas'), - 'text/x-nfo' => 'nfo', - 'text/x-setext' => 'etx', - 'text/x-sfv' => 'sfv', - 'text/x-uuencode' => 'uu', - 'text/x-vcalendar' => 'vcs', - 'text/x-vcard' => 'vcf', - 'video/3gpp' => '3gp', - 'video/3gpp2' => '3g2', - 'video/h261' => 'h261', - 'video/h263' => 'h263', - 'video/h264' => 'h264', - 'video/jpeg' => 'jpgv', - 'video/jpm' => array('jpm', 'jpgm'), - 'video/mj2' => 'mj2', - 'video/mp4' => 'mp4', - 'video/mpeg' => array('mpeg', 'mpg', 'mpe', 'm1v', 'm2v'), - 'video/ogg' => 'ogv', - 'video/quicktime' => array('qt', 'mov'), - 'video/vnd.dece.hd' => array('uvh', 'uvvh'), - 'video/vnd.dece.mobile' => array('uvm', 'uvvm'), - 'video/vnd.dece.pd' => array('uvp', 'uvvp'), - 'video/vnd.dece.sd' => array('uvs', 'uvvs'), - 'video/vnd.dece.video' => array('uvv', 'uvvv'), - 'video/vnd.dvb.file' => 'dvb', - 'video/vnd.fvt' => 'fvt', - 'video/vnd.mpegurl' => array('mxu', 'm4u'), - 'video/vnd.ms-playready.media.pyv' => 'pyv', - 'video/vnd.uvvu.mp4' => array('uvu', 'uvvu'), - 'video/vnd.vivo' => 'viv', - 'video/webm' => 'webm', - 'video/x-f4v' => 'f4v', - 'video/x-fli' => 'fli', - 'video/x-flv' => 'flv', - 'video/x-m4v' => 'm4v', - 'video/x-matroska' => array('mkv', 'mk3d', 'mks'), - 'video/x-mng' => 'mng', - 'video/x-ms-asf' => array('asf', 'asx'), - 'video/x-ms-vob' => 'vob', - 'video/x-ms-wm' => 'wm', - 'video/x-ms-wmv' => 'wmv', - 'video/x-ms-wmx' => 'wmx', - 'video/x-ms-wvx' => 'wvx', - 'video/x-msvideo' => 'avi', - 'video/x-sgi-movie' => 'movie', - ); + /** + * MIME types from the apache.org file. Some types are truncated. + * + * @var array Map of MIME types => file extension(s) + * @link http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + */ + protected static $mimeTypes = array( + 'application/atom+xml' => 'atom', + 'application/ecmascript' => 'ecma', + 'application/emma+xml' => 'emma', + 'application/epub+zip' => 'epub', + 'application/java-archive' => 'jar', + 'application/java-vm' => 'class', + 'application/javascript' => 'js', + 'application/json' => 'json', + 'application/jsonml+json' => 'jsonml', + 'application/lost+xml' => 'lostxml', + 'application/mathml+xml' => 'mathml', + 'application/mets+xml' => 'mets', + 'application/mods+xml' => 'mods', + 'application/mp4' => 'mp4s', + 'application/msword' => array('doc', 'dot'), + 'application/octet-stream' => array( + 'bin', + 'dms', + 'lrf', + 'mar', + 'so', + 'dist', + 'distz', + 'pkg', + 'bpk', + 'dump', + 'elc', + 'deploy' + ), + 'application/ogg' => 'ogx', + 'application/omdoc+xml' => 'omdoc', + 'application/pdf' => 'pdf', + 'application/pgp-encrypted' => 'pgp', + 'application/pgp-signature' => array('asc', 'sig'), + 'application/pkix-pkipath' => 'pkipath', + 'application/pkixcmp' => 'pki', + 'application/pls+xml' => 'pls', + 'application/postscript' => array('ai', 'eps', 'ps'), + 'application/pskc+xml' => 'pskcxml', + 'application/rdf+xml' => 'rdf', + 'application/reginfo+xml' => 'rif', + 'application/rss+xml' => 'rss', + 'application/rtf' => 'rtf', + 'application/sbml+xml' => 'sbml', + 'application/vnd.adobe.air-application-installer-package+zip' => 'air', + 'application/vnd.adobe.xdp+xml' => 'xdp', + 'application/vnd.adobe.xfdf' => 'xfdf', + 'application/vnd.ahead.space' => 'ahead', + 'application/vnd.dart' => 'dart', + 'application/vnd.data-vision.rdz' => 'rdz', + 'application/vnd.dece.data' => array('uvf', 'uvvf', 'uvd', 'uvvd'), + 'application/vnd.dece.ttml+xml' => array('uvt', 'uvvt'), + 'application/vnd.dece.unspecified' => array('uvx', 'uvvx'), + 'application/vnd.dece.zip' => array('uvz', 'uvvz'), + 'application/vnd.denovo.fcselayout-link' => 'fe_launch', + 'application/vnd.dna' => 'dna', + 'application/vnd.dolby.mlp' => 'mlp', + 'application/vnd.dpgraph' => 'dpg', + 'application/vnd.dreamfactory' => 'dfac', + 'application/vnd.ds-keypoint' => 'kpxx', + 'application/vnd.dvb.ait' => 'ait', + 'application/vnd.dvb.service' => 'svc', + 'application/vnd.dynageo' => 'geo', + 'application/vnd.ecowin.chart' => 'mag', + 'application/vnd.enliven' => 'nml', + 'application/vnd.epson.esf' => 'esf', + 'application/vnd.epson.msf' => 'msf', + 'application/vnd.epson.quickanime' => 'qam', + 'application/vnd.epson.salt' => 'slt', + 'application/vnd.epson.ssf' => 'ssf', + 'application/vnd.ezpix-album' => 'ez2', + 'application/vnd.ezpix-package' => 'ez3', + 'application/vnd.fdf' => 'fdf', + 'application/vnd.fdsn.mseed' => 'mseed', + 'application/vnd.fdsn.seed' => array('seed', 'dataless'), + 'application/vnd.flographit' => 'gph', + 'application/vnd.fluxtime.clip' => 'ftc', + 'application/vnd.hal+xml' => 'hal', + 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', + 'application/vnd.ibm.minipay' => 'mpy', + 'application/vnd.ibm.secure-container' => 'sc', + 'application/vnd.iccprofile' => array('icc', 'icm'), + 'application/vnd.igloader' => 'igl', + 'application/vnd.immervision-ivp' => 'ivp', + 'application/vnd.kde.karbon' => 'karbon', + 'application/vnd.kde.kchart' => 'chrt', + 'application/vnd.kde.kformula' => 'kfo', + 'application/vnd.kde.kivio' => 'flw', + 'application/vnd.kde.kontour' => 'kon', + 'application/vnd.kde.kpresenter' => array('kpr', 'kpt'), + 'application/vnd.kde.kspread' => 'ksp', + 'application/vnd.kde.kword' => array('kwd', 'kwt'), + 'application/vnd.kenameaapp' => 'htke', + 'application/vnd.kidspiration' => 'kia', + 'application/vnd.kinar' => array('kne', 'knp'), + 'application/vnd.koan' => array('skp', 'skd', 'skt', 'skm'), + 'application/vnd.kodak-descriptor' => 'sse', + 'application/vnd.las.las+xml' => 'lasxml', + 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', + 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', + 'application/vnd.lotus-1-2-3' => '123', + 'application/vnd.lotus-approach' => 'apr', + 'application/vnd.lotus-freelance' => 'pre', + 'application/vnd.lotus-notes' => 'nsf', + 'application/vnd.lotus-organizer' => 'org', + 'application/vnd.lotus-screencam' => 'scm', + 'application/vnd.mozilla.xul+xml' => 'xul', + 'application/vnd.ms-artgalry' => 'cil', + 'application/vnd.ms-cab-compressed' => 'cab', + 'application/vnd.ms-excel' => array( + 'xls', + 'xlm', + 'xla', + 'xlc', + 'xlt', + 'xlw' + ), + 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', + 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', + 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', + 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', + 'application/vnd.ms-fontobject' => 'eot', + 'application/vnd.ms-htmlhelp' => 'chm', + 'application/vnd.ms-ims' => 'ims', + 'application/vnd.ms-lrm' => 'lrm', + 'application/vnd.ms-officetheme' => 'thmx', + 'application/vnd.ms-pki.seccat' => 'cat', + 'application/vnd.ms-pki.stl' => 'stl', + 'application/vnd.ms-powerpoint' => array('ppt', 'pps', 'pot'), + 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', + 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', + 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', + 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', + 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', + 'application/vnd.ms-project' => array('mpp', 'mpt'), + 'application/vnd.ms-word.document.macroenabled.12' => 'docm', + 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', + 'application/vnd.ms-works' => array('wps', 'wks', 'wcm', 'wdb'), + 'application/vnd.ms-wpl' => 'wpl', + 'application/vnd.ms-xpsdocument' => 'xps', + 'application/vnd.mseq' => 'mseq', + 'application/vnd.musician' => 'mus', + 'application/vnd.oasis.opendocument.chart' => 'odc', + 'application/vnd.oasis.opendocument.chart-template' => 'otc', + 'application/vnd.oasis.opendocument.database' => 'odb', + 'application/vnd.oasis.opendocument.formula' => 'odf', + 'application/vnd.oasis.opendocument.formula-template' => 'odft', + 'application/vnd.oasis.opendocument.graphics' => 'odg', + 'application/vnd.oasis.opendocument.graphics-template' => 'otg', + 'application/vnd.oasis.opendocument.image' => 'odi', + 'application/vnd.oasis.opendocument.image-template' => 'oti', + 'application/vnd.oasis.opendocument.presentation' => 'odp', + 'application/vnd.oasis.opendocument.presentation-template' => 'otp', + 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', + 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', + 'application/vnd.oasis.opendocument.text' => 'odt', + 'application/vnd.oasis.opendocument.text-master' => 'odm', + 'application/vnd.oasis.opendocument.text-template' => 'ott', + 'application/vnd.oasis.opendocument.text-web' => 'oth', + 'application/vnd.olpc-sugar' => 'xo', + 'application/vnd.oma.dd2+xml' => 'dd2', + 'application/vnd.openofficeorg.extension' => 'oxt', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', + 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', + 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', + 'application/vnd.pvi.ptid1' => 'ptid', + 'application/vnd.quark.quarkxpress' => array( + 'qxd', + 'qxt', + 'qwd', + 'qwt', + 'qxl', + 'qxb' + ), + 'application/vnd.realvnc.bed' => 'bed', + 'application/vnd.recordare.musicxml' => 'mxl', + 'application/vnd.recordare.musicxml+xml' => 'musicxml', + 'application/vnd.rig.cryptonote' => 'cryptonote', + 'application/vnd.rim.cod' => 'cod', + 'application/vnd.rn-realmedia' => 'rm', + 'application/vnd.rn-realmedia-vbr' => 'rmvb', + 'application/vnd.route66.link66+xml' => 'link66', + 'application/vnd.sailingtracker.track' => 'st', + 'application/vnd.seemail' => 'see', + 'application/vnd.sema' => 'sema', + 'application/vnd.semd' => 'semd', + 'application/vnd.semf' => 'semf', + 'application/vnd.shana.informed.formdata' => 'ifm', + 'application/vnd.shana.informed.formtemplate' => 'itp', + 'application/vnd.shana.informed.interchange' => 'iif', + 'application/vnd.shana.informed.package' => 'ipk', + 'application/vnd.simtech-mindmapper' => array('twd', 'twds'), + 'application/vnd.smaf' => 'mmf', + 'application/vnd.stepmania.stepchart' => 'sm', + 'application/vnd.sun.xml.calc' => 'sxc', + 'application/vnd.sun.xml.calc.template' => 'stc', + 'application/vnd.sun.xml.draw' => 'sxd', + 'application/vnd.sun.xml.draw.template' => 'std', + 'application/vnd.sun.xml.impress' => 'sxi', + 'application/vnd.sun.xml.impress.template' => 'sti', + 'application/vnd.sun.xml.math' => 'sxm', + 'application/vnd.sun.xml.writer' => 'sxw', + 'application/vnd.sun.xml.writer.global' => 'sxg', + 'application/vnd.sun.xml.writer.template' => 'stw', + 'application/vnd.sus-calendar' => array('sus', 'susp'), + 'application/vnd.svd' => 'svd', + 'application/vnd.symbian.install' => array('sis', 'sisx'), + 'application/vnd.syncml+xml' => 'xsm', + 'application/vnd.syncml.dm+wbxml' => 'bdm', + 'application/vnd.syncml.dm+xml' => 'xdm', + 'application/vnd.tao.intent-module-archive' => 'tao', + 'application/vnd.tcpdump.pcap' => array('pcap', 'cap', 'dmp'), + 'application/vnd.tmobile-livetv' => 'tmo', + 'application/vnd.trid.tpt' => 'tpt', + 'application/vnd.triscape.mxs' => 'mxs', + 'application/vnd.trueapp' => 'tra', + 'application/vnd.ufdl' => array('ufd', 'ufdl'), + 'application/vnd.uiq.theme' => 'utz', + 'application/vnd.umajin' => 'umj', + 'application/vnd.unity' => 'unityweb', + 'application/vnd.uoml+xml' => 'uoml', + 'application/vnd.vcx' => 'vcx', + 'application/vnd.visio' => array('vsd', 'vst', 'vss', 'vsw'), + 'application/vnd.visionary' => 'vis', + 'application/vnd.vsf' => 'vsf', + 'application/vnd.wap.wbxml' => 'wbxml', + 'application/vnd.wap.wmlc' => 'wmlc', + 'application/vnd.wap.wmlscriptc' => 'wmlsc', + 'application/vnd.webturbo' => 'wtb', + 'application/vnd.wolfram.player' => 'nbp', + 'application/vnd.wordperfect' => 'wpd', + 'application/vnd.wqd' => 'wqd', + 'application/vnd.wt.stf' => 'stf', + 'application/vnd.xara' => 'xar', + 'application/vnd.xfdl' => 'xfdl', + 'application/voicexml+xml' => 'vxml', + 'application/widget' => 'wgt', + 'application/winhlp' => 'hlp', + 'application/wsdl+xml' => 'wsdl', + 'application/wspolicy+xml' => 'wspolicy', + 'application/x-7z-compressed' => '7z', + 'application/x-bittorrent' => 'torrent', + 'application/x-blorb' => array('blb', 'blorb'), + 'application/x-bzip' => 'bz', + 'application/x-cdlink' => 'vcd', + 'application/x-cfs-compressed' => 'cfs', + 'application/x-chat' => 'chat', + 'application/x-chess-pgn' => 'pgn', + 'application/x-conference' => 'nsc', + 'application/x-cpio' => 'cpio', + 'application/x-csh' => 'csh', + 'application/x-debian-package' => array('deb', 'udeb'), + 'application/x-dgc-compressed' => 'dgc', + 'application/x-director' => array( + 'dir', + 'dcr', + 'dxr', + 'cst', + 'cct', + 'cxt', + 'w3d', + 'fgd', + 'swa' + ), + 'application/x-font-ttf' => array('ttf', 'ttc'), + 'application/x-font-type1' => array('pfa', 'pfb', 'pfm', 'afm'), + 'application/x-font-woff' => 'woff', + 'application/x-freearc' => 'arc', + 'application/x-futuresplash' => 'spl', + 'application/x-gca-compressed' => 'gca', + 'application/x-glulx' => 'ulx', + 'application/x-gnumeric' => 'gnumeric', + 'application/x-gramps-xml' => 'gramps', + 'application/x-gtar' => 'gtar', + 'application/x-hdf' => 'hdf', + 'application/x-install-instructions' => 'install', + 'application/x-iso9660-image' => 'iso', + 'application/x-java-jnlp-file' => 'jnlp', + 'application/x-latex' => 'latex', + 'application/x-lzh-compressed' => array('lzh', 'lha'), + 'application/x-mie' => 'mie', + 'application/x-mobipocket-ebook' => array('prc', 'mobi'), + 'application/x-ms-application' => 'application', + 'application/x-ms-shortcut' => 'lnk', + 'application/x-ms-wmd' => 'wmd', + 'application/x-ms-wmz' => 'wmz', + 'application/x-ms-xbap' => 'xbap', + 'application/x-msaccess' => 'mdb', + 'application/x-msbinder' => 'obd', + 'application/x-mscardfile' => 'crd', + 'application/x-msclip' => 'clp', + 'application/x-msdownload' => array('exe', 'dll', 'com', 'bat', 'msi'), + 'application/x-msmediaview' => array( + 'mvb', + 'm13', + 'm14' + ), + 'application/x-msmetafile' => array('wmf', 'wmz', 'emf', 'emz'), + 'application/x-rar-compressed' => 'rar', + 'application/x-research-info-systems' => 'ris', + 'application/x-sh' => 'sh', + 'application/x-shar' => 'shar', + 'application/x-shockwave-flash' => 'swf', + 'application/x-silverlight-app' => 'xap', + 'application/x-sql' => 'sql', + 'application/x-stuffit' => 'sit', + 'application/x-stuffitx' => 'sitx', + 'application/x-subrip' => 'srt', + 'application/x-sv4cpio' => 'sv4cpio', + 'application/x-sv4crc' => 'sv4crc', + 'application/x-t3vm-image' => 't3', + 'application/x-tads' => 'gam', + 'application/x-tar' => 'tar', + 'application/x-tcl' => 'tcl', + 'application/x-tex' => 'tex', + 'application/x-tex-tfm' => 'tfm', + 'application/x-texinfo' => array('texinfo', 'texi'), + 'application/x-tgif' => 'obj', + 'application/x-ustar' => 'ustar', + 'application/x-wais-source' => 'src', + 'application/x-x509-ca-cert' => array('der', 'crt'), + 'application/x-xfig' => 'fig', + 'application/x-xliff+xml' => 'xlf', + 'application/x-xpinstall' => 'xpi', + 'application/x-xz' => 'xz', + 'application/x-zmachine' => 'z1', + 'application/xaml+xml' => 'xaml', + 'application/xcap-diff+xml' => 'xdf', + 'application/xenc+xml' => 'xenc', + 'application/xhtml+xml' => array('xhtml', 'xht'), + 'application/xml' => array('xml', 'xsl'), + 'application/xml-dtd' => 'dtd', + 'application/xop+xml' => 'xop', + 'application/xproc+xml' => 'xpl', + 'application/xslt+xml' => 'xslt', + 'application/xspf+xml' => 'xspf', + 'application/xv+xml' => array('mxml', 'xhvml', 'xvml', 'xvm'), + 'application/yang' => 'yang', + 'application/yin+xml' => 'yin', + 'application/zip' => 'zip', + 'audio/adpcm' => 'adp', + 'audio/basic' => array('au', 'snd'), + 'audio/midi' => array('mid', 'midi', 'kar', 'rmi'), + 'audio/mp4' => 'mp4a', + 'audio/mpeg' => array( + 'mpga', + 'mp2', + 'mp2a', + 'mp3', + 'm2a', + 'm3a' + ), + 'audio/ogg' => array('oga', 'ogg', 'spx'), + 'audio/vnd.dece.audio' => array('uva', 'uvva'), + 'audio/vnd.rip' => 'rip', + 'audio/webm' => 'weba', + 'audio/x-aac' => 'aac', + 'audio/x-aiff' => array('aif', 'aiff', 'aifc'), + 'audio/x-caf' => 'caf', + 'audio/x-flac' => 'flac', + 'audio/x-matroska' => 'mka', + 'audio/x-mpegurl' => 'm3u', + 'audio/x-ms-wax' => 'wax', + 'audio/x-ms-wma' => 'wma', + 'audio/x-pn-realaudio' => array('ram', 'ra'), + 'audio/x-pn-realaudio-plugin' => 'rmp', + 'audio/x-wav' => 'wav', + 'audio/xm' => 'xm', + 'image/bmp' => 'bmp', + 'image/cgm' => 'cgm', + 'image/g3fax' => 'g3', + 'image/gif' => 'gif', + 'image/ief' => 'ief', + 'image/jpeg' => array('jpeg', 'jpg', 'jpe'), + 'image/ktx' => 'ktx', + 'image/png' => 'png', + 'image/prs.btif' => 'btif', + 'image/sgi' => 'sgi', + 'image/svg+xml' => array('svg', 'svgz'), + 'image/tiff' => array('tiff', 'tif'), + 'image/vnd.adobe.photoshop' => 'psd', + 'image/vnd.dece.graphic' => array('uvi', 'uvvi', 'uvg', 'uvvg'), + 'image/vnd.dvb.subtitle' => 'sub', + 'image/vnd.djvu' => array('djvu', 'djv'), + 'image/vnd.dwg' => 'dwg', + 'image/vnd.dxf' => 'dxf', + 'image/vnd.fastbidsheet' => 'fbs', + 'image/vnd.fpx' => 'fpx', + 'image/vnd.fst' => 'fst', + 'image/vnd.fujixerox.edmics-mmr' => 'mmr', + 'image/vnd.fujixerox.edmics-rlc' => 'rlc', + 'image/vnd.ms-modi' => 'mdi', + 'image/vnd.ms-photo' => 'wdp', + 'image/vnd.net-fpx' => 'npx', + 'image/vnd.wap.wbmp' => 'wbmp', + 'image/vnd.xiff' => 'xif', + 'image/webp' => 'webp', + 'image/x-3ds' => '3ds', + 'image/x-cmu-raster' => 'ras', + 'image/x-cmx' => 'cmx', + 'image/x-freehand' => array('fh', 'fhc', 'fh4', 'fh5', 'fh7'), + 'image/x-icon' => 'ico', + 'image/x-mrsid-image' => 'sid', + 'image/x-pcx' => 'pcx', + 'image/x-pict' => array('pic', 'pct'), + 'image/x-portable-anymap' => 'pnm', + 'image/x-portable-bitmap' => 'pbm', + 'image/x-portable-graymap' => 'pgm', + 'image/x-portable-pixmap' => 'ppm', + 'image/x-rgb' => 'rgb', + 'image/x-tga' => 'tga', + 'image/x-xbitmap' => 'xbm', + 'image/x-xpixmap' => 'xpm', + 'image/x-xwindowdump' => 'xwd', + 'message/rfc822' => array('eml', 'mime'), + 'model/iges' => array('igs', 'iges'), + 'model/mesh' => array('msh', 'mesh', 'silo'), + 'model/vnd.collada+xml' => 'dae', + 'model/vnd.dwf' => 'dwf', + 'model/vnd.gdl' => 'gdl', + 'model/vnd.gtw' => 'gtw', + 'model/vnd.mts' => 'mts', + 'model/vnd.vtu' => 'vtu', + 'model/vrml' => array('wrl', 'vrml'), + 'model/x3d+binary' => 'x3db', + 'model/x3d+vrml' => 'x3dv', + 'model/x3d+xml' => 'x3d', + 'text/cache-manifest' => 'appcache', + 'text/calendar' => array('ics', 'ifb'), + 'text/css' => 'css', + 'text/csv' => 'csv', + 'text/html' => array('html', 'htm'), + 'text/n3' => 'n3', + 'text/plain' => array( + 'txt', + 'text', + 'conf', + 'def', + 'list', + 'log', + 'in' + ), + 'text/prs.lines.tag' => 'dsc', + 'text/richtext' => 'rtx', + 'text/sgml' => array('sgml', 'sgm'), + 'text/tab-separated-values' => 'tsv', + 'text/troff' => array( + 't', + 'tr', + 'roff', + 'man', + 'me', + 'ms' + ), + 'text/turtle' => 'ttl', + 'text/uri-list' => array('uri', 'uris', 'urls'), + 'text/vcard' => 'vcard', + 'text/vnd.curl' => 'curl', + 'text/vnd.curl.dcurl' => 'dcurl', + 'text/vnd.curl.scurl' => 'scurl', + 'text/vnd.curl.mcurl' => 'mcurl', + 'text/vnd.dvb.subtitle' => 'sub', + 'text/vnd.fly' => 'fly', + 'text/vnd.fmi.flexstor' => 'flx', + 'text/vnd.graphviz' => 'gv', + 'text/vnd.in3d.3dml' => '3dml', + 'text/vnd.in3d.spot' => 'spot', + 'text/vnd.sun.j2me.app-descriptor' => 'jad', + 'text/vnd.wap.wml' => 'wml', + 'text/vnd.wap.wmlscript' => 'wmls', + 'text/x-asm' => array('s', 'asm'), + 'text/x-fortran' => array('f', 'for', 'f77', 'f90'), + 'text/x-java-source' => 'java', + 'text/x-opml' => 'opml', + 'text/x-pascal' => array('p', 'pas'), + 'text/x-nfo' => 'nfo', + 'text/x-setext' => 'etx', + 'text/x-sfv' => 'sfv', + 'text/x-uuencode' => 'uu', + 'text/x-vcalendar' => 'vcs', + 'text/x-vcard' => 'vcf', + 'video/3gpp' => '3gp', + 'video/3gpp2' => '3g2', + 'video/h261' => 'h261', + 'video/h263' => 'h263', + 'video/h264' => 'h264', + 'video/jpeg' => 'jpgv', + 'video/jpm' => array('jpm', 'jpgm'), + 'video/mj2' => 'mj2', + 'video/mp4' => 'mp4', + 'video/mpeg' => array('mpeg', 'mpg', 'mpe', 'm1v', 'm2v'), + 'video/ogg' => 'ogv', + 'video/quicktime' => array('qt', 'mov'), + 'video/vnd.dece.hd' => array('uvh', 'uvvh'), + 'video/vnd.dece.mobile' => array('uvm', 'uvvm'), + 'video/vnd.dece.pd' => array('uvp', 'uvvp'), + 'video/vnd.dece.sd' => array('uvs', 'uvvs'), + 'video/vnd.dece.video' => array('uvv', 'uvvv'), + 'video/vnd.dvb.file' => 'dvb', + 'video/vnd.fvt' => 'fvt', + 'video/vnd.mpegurl' => array('mxu', 'm4u'), + 'video/vnd.ms-playready.media.pyv' => 'pyv', + 'video/vnd.uvvu.mp4' => array('uvu', 'uvvu'), + 'video/vnd.vivo' => 'viv', + 'video/webm' => 'webm', + 'video/x-f4v' => 'f4v', + 'video/x-fli' => 'fli', + 'video/x-flv' => 'flv', + 'video/x-m4v' => 'm4v', + 'video/x-matroska' => array('mkv', 'mk3d', 'mks'), + 'video/x-mng' => 'mng', + 'video/x-ms-asf' => array('asf', 'asx'), + 'video/x-ms-vob' => 'vob', + 'video/x-ms-wm' => 'wm', + 'video/x-ms-wmv' => 'wmv', + 'video/x-ms-wmx' => 'wmx', + 'video/x-ms-wvx' => 'wvx', + 'video/x-msvideo' => 'avi', + 'video/x-sgi-movie' => 'movie', + ); + /** + * Get a random MIME type + * + * @return string + * @example 'video/avi' + */ + public static function mimeType() + { + return static::randomElement(array_keys(static::$mimeTypes)); + } - /** - * Get a random MIME type - * - * @return string - * @example 'video/avi' - */ - public static function mimeType() - { - return static::randomElement(array_keys(static::$mimeTypes)); - } + /** + * Get a random file extension (without a dot) + * + * @example avi + * @return string + */ + public static function fileExtension() + { + $random_extension = static::randomElement(array_values(static::$mimeTypes)); - /** - * Get a random file extension (without a dot) - * - * @example avi - * @return string - */ - public static function fileExtension() - { - $random_extension = static::randomElement(array_values(static::$mimeTypes)); - return is_array($random_extension) ? static::randomElement($random_extension) : $random_extension; - } -} \ No newline at end of file + return is_array($random_extension) ? static::randomElement($random_extension) : $random_extension; + } +} diff --git a/src/Faker/Provider/Internet.php b/src/Faker/Provider/Internet.php index 0ba80f90..e89d0eca 100644 --- a/src/Faker/Provider/Internet.php +++ b/src/Faker/Provider/Internet.php @@ -35,7 +35,7 @@ class Internet extends \Faker\Provider\Base /** * @example 'jdoe@example.com' */ - public final function safeEmail() + final public function safeEmail() { return preg_replace('/\s/u', '', $this->userName() . '@' . static::safeEmailDomain()); } @@ -63,11 +63,11 @@ class Internet extends \Faker\Provider\Base { return static::randomElement(static::$freeEmailDomain); } - + /** * @example 'example.org' */ - public static final function safeEmailDomain() + final public static function safeEmailDomain() { $domains = array( 'example.com', diff --git a/src/Faker/Provider/Miscellaneous.php b/src/Faker/Provider/Miscellaneous.php index 0c4fd32b..9a56fbe6 100644 --- a/src/Faker/Provider/Miscellaneous.php +++ b/src/Faker/Provider/Miscellaneous.php @@ -7,22 +7,22 @@ class Miscellaneous extends \Faker\Provider\Base protected static $languageCode = array('cn', 'de', 'en', 'es', 'fr', 'it', 'pt', 'ru'); protected static $countryCode = array('CA', 'CN', 'DE', 'ES', 'FR', 'IE', 'IN', 'IT', 'MX', 'PT', 'RU', 'UK', 'US'); - + protected static $localeData = array( - 'aa_DJ', 'aa_ER', 'aa_ET', - 'af_NA', 'af_ZA', 'ak_GH', + 'aa_DJ', 'aa_ER', 'aa_ET', + 'af_NA', 'af_ZA', 'ak_GH', 'am_ET', 'ar_AE', 'ar_BH', 'ar_DZ', 'ar_EG', 'ar_IQ', 'ar_JO', 'ar_KW', 'ar_LB', 'ar_LY', 'ar_MA', 'ar_OM', 'ar_QA', 'ar_SA', - 'ar_SD', 'ar_SY', 'ar_TN', 'ar_YE', + 'ar_SD', 'ar_SY', 'ar_TN', 'ar_YE', 'as_IN', 'az_AZ', 'be_BY', 'bg_BG', 'bn_BD', 'bn_IN', 'bo_CN', 'bo_IN', 'bs_BA', - 'byn_ER', 'ca_ES', - 'cch_NG', 'cs_CZ', + 'byn_ER', 'ca_ES', + 'cch_NG', 'cs_CZ', 'cy_GB', 'da_DK', 'de_AT', 'de_BE', 'de_CH', 'de_DE', 'de_LI', 'de_LU', - 'dv_MV', 'dz_BT', + 'dv_MV', 'dz_BT', 'ee_GH', 'ee_TG', 'el_CY', 'el_GR', 'en_AS', 'en_AU', 'en_BE', 'en_BW', 'en_BZ', 'en_CA', 'en_GB', 'en_GU', 'en_HK', @@ -33,59 +33,59 @@ class Miscellaneous extends \Faker\Provider\Base 'es_BO', 'es_CL', 'es_CO', 'es_CR', 'es_DO', 'es_EC', 'es_ES', 'es_GT', 'es_HN', 'es_MX', 'es_NI', 'es_PA', 'es_PE', 'es_PR', 'es_PY', - 'es_SV', 'es_US', 'es_UY', 'es_VE', + 'es_SV', 'es_US', 'es_UY', 'es_VE', 'et_EE', 'eu_ES', 'fa_AF', 'fa_IR', 'fi_FI', 'fil_PH', 'fo_FO', 'fr_BE', 'fr_CA', 'fr_CH', 'fr_FR', 'fr_LU', 'fr_MC', 'fr_SN', - 'fur_IT', 'ga_IE', - 'gaa_GH', 'gez_ER', 'gez_ET', + 'fur_IT', 'ga_IE', + 'gaa_GH', 'gez_ER', 'gez_ET', 'gl_ES', 'gsw_CH', 'gu_IN', 'gv_GB', 'ha_GH', 'ha_NE', - 'ha_NG', 'ha_SD', 'haw_US', + 'ha_NG', 'ha_SD', 'haw_US', 'he_IL', 'hi_IN', 'hr_HR', - 'hu_HU', 'hy_AM', - 'id_ID', 'ig_NG', - 'ii_CN', 'is_IS', - 'it_CH', 'it_IT', + 'hu_HU', 'hy_AM', + 'id_ID', 'ig_NG', + 'ii_CN', 'is_IS', + 'it_CH', 'it_IT', 'ja_JP', 'ka_GE', 'kaj_NG', - 'kam_KE', 'kcg_NG', + 'kam_KE', 'kcg_NG', 'kfo_CI', 'kk_KZ', 'kl_GL', - 'km_KH', 'kn_IN', + 'km_KH', 'kn_IN', 'ko_KR', 'kok_IN', 'kpe_GN', 'kpe_LR', 'ku_IQ', 'ku_IR', 'ku_SY', 'ku_TR', 'kw_GB', 'ky_KG', 'ln_CD', 'ln_CG', 'lo_LA', - 'lt_LT', 'lv_LV', + 'lt_LT', 'lv_LV', 'mk_MK', 'ml_IN', 'mn_CN', - 'mn_MN', 'mr_IN', - 'ms_BN', 'ms_MY', 'mt_MT', + 'mn_MN', 'mr_IN', + 'ms_BN', 'ms_MY', 'mt_MT', 'my_MM', 'nb_NO', 'nds_DE', 'ne_IN', 'ne_NP', 'nl_BE', - 'nl_NL', 'nn_NO', + 'nl_NL', 'nn_NO', 'nr_ZA', 'nso_ZA', 'ny_MW', 'oc_FR', 'om_ET', 'om_KE', 'or_IN', 'pa_IN', 'pa_PK', - 'pl_PL', 'ps_AF', + 'pl_PL', 'ps_AF', 'pt_BR', 'pt_PT', 'ro_MD', 'ro_RO', 'ru_RU', 'ru_UA', 'rw_RW', 'sa_IN', 'se_FI', 'se_NO', - 'sh_BA', 'sh_CS', 'sh_YU', + 'sh_BA', 'sh_CS', 'sh_YU', 'si_LK', 'sid_ET', 'sk_SK', 'sl_SI', 'so_DJ', 'so_ET', - 'so_KE', 'so_SO', 'sq_AL', + 'so_KE', 'so_SO', 'sq_AL', 'sr_BA', 'sr_CS', 'sr_ME', 'sr_RS', 'sr_YU', 'ss_SZ', 'ss_ZA', 'st_LS', - 'st_ZA', 'sv_FI', 'sv_SE', + 'st_ZA', 'sv_FI', 'sv_SE', 'sw_KE', 'sw_TZ', 'syr_SY', 'ta_IN', 'te_IN', 'tg_TJ', 'th_TH', 'ti_ER', 'ti_ET', 'tig_ER', 'tn_ZA', - 'to_TO', 'tr_TR', + 'to_TO', 'tr_TR', 'trv_TW', 'ts_ZA', 'tt_RU', - 'ug_CN', 'uk_UA', + 'ug_CN', 'uk_UA', 'ur_IN', 'ur_PK', 'uz_AF', 'uz_UZ', - 've_ZA', 'vi_VN', + 've_ZA', 'vi_VN', 'wal_ET', 'wo_SN', 'xh_ZA', 'yo_NG', 'zh_CN', 'zh_HK', 'zh_MO', 'zh_SG', 'zh_TW', 'zu_ZA', @@ -129,7 +129,7 @@ class Miscellaneous extends \Faker\Provider\Base * @example 'fr_FR' */ public function locale() - { + { return static::randomElement(static::$localeData); } diff --git a/src/Faker/Provider/en_CA/Address.php b/src/Faker/Provider/en_CA/Address.php index 3dbb8487..0aef7e9f 100644 --- a/src/Faker/Provider/en_CA/Address.php +++ b/src/Faker/Provider/en_CA/Address.php @@ -24,7 +24,6 @@ class Address extends \Faker\Provider\en_US\Address "{{streetAddress}}\n{{city}}, {{provinceAbbr}} {{postcode}}", ); - /** * @example 'Ontario' */ @@ -50,7 +49,6 @@ class Address extends \Faker\Provider\en_US\Address return static::randomElement(static::$postcodeLetters); } - /** * @example A1B 2C3 */ @@ -64,6 +62,4 @@ class Address extends \Faker\Provider\en_US\Address return static::toUpper($string); } - - } diff --git a/src/Faker/Provider/fr_BE/Address.php b/src/Faker/Provider/fr_BE/Address.php index cb6a3e0b..dd48c063 100644 --- a/src/Faker/Provider/fr_BE/Address.php +++ b/src/Faker/Provider/fr_BE/Address.php @@ -28,17 +28,17 @@ class Address extends \Faker\Provider\Address * @var array */ protected static $cityNames = array( - 'Aarschot','Alost (Aalst)','Andenne','Antoing','Anvers (Antwerpen)','Arlon','Ath','Audenarde (Oudenaarde)','Bastogne','Beaumont','Beauraing','Beringen','Bilzen','Binche', - 'Blankenberge','Bouillon','Braine-le-Comte','Bree','Bruges (Brugge)','Bruxelles','Charleroi','Châtelet','Chièvres','Chimay','Chiny','Ciney','Comines-Warneton','Courtrai (Kortrijk)', - 'Couvin','Damme','Deinze','Diest','Dilsen-Stokkem','Dinant','Dixmude (Diksmuide)','Durbuy','Eeklo','Enghien','Eupen','Fleurus','Florenville','Fontaine-l\'Évêque','Fosses-la-Ville', - 'Furnes (Veurne)','Gand (Gent)','Geel','Gembloux','Genappe','Genk','Gistel','Grammont (Geraardsbergen)','Hal (Halle)','Halen','Hamont-Achel','Hannut','Harelbeke','Hasselt', - 'Herck-la-Ville (Herk-de-Stad)','Herentals','Herstal','Herve','Hoogstraten','Houffalize','Huy','Izegem','Jodoigne','La Louvière','La Roche-en-Ardenne','Landen','Léau (Zoutleeuw)', - 'Le Rœulx','Lessines','Leuze-en-Hainaut','Liège','Lierre (Lier)','Limbourg','Lokeren','Lommel','Looz (Borgloon)','Lo-Reninge','Louvain (Leuven)','Maaseik','Malines (Mechelen)', - 'Malmedy','Marche-en-Famenne','Menin (Menen)','Messines (Mesen)','Mons','Montaigu-Zichem (Scherpenheuvel-Zichem)','Mortsel','Mouscron','Namur','Neufchâteau','Nieuport (Nieuwpoort)', - 'Ninove','Nivelles','Ostende (Oostende)','Ottignies-Louvain-la-Neuve','Oudenburg','Peer','Péruwelz','Philippeville','Poperinge','Renaix (Ronse)','Rochefort','Roulers (Roeselare)', - 'Saint-Ghislain','Saint-Hubert','Saint-Nicolas (Sint-Niklaas)','Saint-Trond (Sint-Truiden)','Saint-Vith (Sankt Vith)','Seraing','Soignies','Stavelot','Termonde (Dendermonde)','Thuin', - 'Tielt','Tirlemont (Tienen)','Tongres (Tongeren)','Torhout','Tournai','Turnhout','Verviers','Vilvorde (Vilvoorde)','Virton','Visé','Walcourt','Waregem','Waremme','Wavre','Wervik', - 'Ypres (Ieper)','Zottegem' + 'Aarschot','Alost (Aalst)','Andenne','Antoing','Anvers (Antwerpen)','Arlon','Ath','Audenarde (Oudenaarde)','Bastogne','Beaumont','Beauraing','Beringen','Bilzen','Binche', + 'Blankenberge','Bouillon','Braine-le-Comte','Bree','Bruges (Brugge)','Bruxelles','Charleroi','Châtelet','Chièvres','Chimay','Chiny','Ciney','Comines-Warneton','Courtrai (Kortrijk)', + 'Couvin','Damme','Deinze','Diest','Dilsen-Stokkem','Dinant','Dixmude (Diksmuide)','Durbuy','Eeklo','Enghien','Eupen','Fleurus','Florenville','Fontaine-l\'Évêque','Fosses-la-Ville', + 'Furnes (Veurne)','Gand (Gent)','Geel','Gembloux','Genappe','Genk','Gistel','Grammont (Geraardsbergen)','Hal (Halle)','Halen','Hamont-Achel','Hannut','Harelbeke','Hasselt', + 'Herck-la-Ville (Herk-de-Stad)','Herentals','Herstal','Herve','Hoogstraten','Houffalize','Huy','Izegem','Jodoigne','La Louvière','La Roche-en-Ardenne','Landen','Léau (Zoutleeuw)', + 'Le Rœulx','Lessines','Leuze-en-Hainaut','Liège','Lierre (Lier)','Limbourg','Lokeren','Lommel','Looz (Borgloon)','Lo-Reninge','Louvain (Leuven)','Maaseik','Malines (Mechelen)', + 'Malmedy','Marche-en-Famenne','Menin (Menen)','Messines (Mesen)','Mons','Montaigu-Zichem (Scherpenheuvel-Zichem)','Mortsel','Mouscron','Namur','Neufchâteau','Nieuport (Nieuwpoort)', + 'Ninove','Nivelles','Ostende (Oostende)','Ottignies-Louvain-la-Neuve','Oudenburg','Peer','Péruwelz','Philippeville','Poperinge','Renaix (Ronse)','Rochefort','Roulers (Roeselare)', + 'Saint-Ghislain','Saint-Hubert','Saint-Nicolas (Sint-Niklaas)','Saint-Trond (Sint-Truiden)','Saint-Vith (Sankt Vith)','Seraing','Soignies','Stavelot','Termonde (Dendermonde)','Thuin', + 'Tielt','Tirlemont (Tienen)','Tongres (Tongeren)','Torhout','Tournai','Turnhout','Verviers','Vilvorde (Vilvoorde)','Virton','Visé','Walcourt','Waregem','Waremme','Wavre','Wervik', + 'Ypres (Ieper)','Zottegem' ); protected static $region = array( @@ -59,9 +59,9 @@ class Address extends \Faker\Provider\Address /** * Randomly returns a belgian region. - * + * * @example 'wallonne' - * + * * @return string */ public static function region() @@ -71,9 +71,9 @@ class Address extends \Faker\Provider\Address /** * Randomly returns a belgian province. - * + * * @example 'Hainaut' - * + * * @return string */ public static function province() diff --git a/src/Faker/Provider/fr_BE/Person.php b/src/Faker/Provider/fr_BE/Person.php index cee36986..92a2090b 100644 --- a/src/Faker/Provider/fr_BE/Person.php +++ b/src/Faker/Provider/fr_BE/Person.php @@ -5,42 +5,42 @@ namespace Faker\Provider\fr_BE; class Person extends \Faker\Provider\Person { protected static $firstName = array( - 'Aaron', 'Adam', 'Adrien', 'Alessio', 'Alexander', 'Alexandre', 'Alexia', 'Alexis', 'Alice', 'Alicia', 'Alyssa', 'Amber', 'Amélie', 'Amy', 'Anaïs', 'Anna', 'Anouk', 'Antoine', - 'Arne', 'Arthur', 'Axel', 'Axelle', 'Aya', 'Ayoub', 'Baptiste', 'Benjamin', 'Bo', 'Camille', 'Célia', 'Charlotte', 'Chiara', 'Chloé', 'Clara', 'Clémence', 'Clément', 'Daan', - 'David', 'Diego', 'Dylan', 'Elena', 'Elias', 'Eline', 'Elisa', 'Elise', 'Ella', 'Eloïse', 'Emiel', 'Emile', 'Emilie', 'Emma', 'Enzo', 'Estelle', 'Ethan', 'Eva', 'Febe', 'Femke', - 'Ferre', 'Fien', 'Finn', 'Fleur', 'Florian', 'Gabriel', 'Gilles', 'Giulia', 'Guillaume', 'Hajar', 'Hamza', 'Hanne', 'Helena', 'Hugo', 'Ilias', 'Ines', 'Inès', 'Jade', 'Jana', 'Janne', - 'Jarne', 'Jasper', 'Jeanne', 'Jelle', 'Jonas', 'Jules', 'Julia', 'Julie', 'Julien', 'Juliette', 'Kaat', 'Kato', 'Kobe', 'Lana', 'Lander', 'Lara', 'Lars', 'Laura', 'Laure', 'Léa', - 'Lena', 'Leon', 'Liam', 'Lien', 'Lilou', 'Lily', 'Lina', 'Linde', 'Lisa', 'Lise', 'Loïc', 'Lola', 'Lore', 'Lotte', 'Louis', 'Louise', 'Lowie', 'Luca', 'Lucas', 'Lucie', 'Lukas', - 'Luna', 'Maëlle', 'Malak', 'Manon', 'Margaux', 'Margot', 'Marie', 'Marion', 'Martin', 'Mathéo', 'Mathias', 'Mathis', 'Mathys', 'Mats', 'Matteo', 'Mauro', 'Maxim', 'Maxime', 'Maya', - 'Mehdi', 'Merel', 'Mila', 'Milan', 'Mohamed', 'Mohammed', 'Nathan', 'Nicolas', 'Niels', 'Nina', 'Noa', 'Noah', 'Noé', 'Noémie', 'Nolan', 'Noor', 'Nora', 'Nore', 'Océane', 'Olivia', - 'Pauline', 'Quinten', 'Rania', 'Raphaël', 'Rayan', 'Robbe', 'Robin', 'Romain', 'Romane', 'Roos', 'Ruben', 'Rune', 'Sacha', 'Salma', 'Sam', 'Samuel', 'Sander', 'Sara', 'Sarah', 'Senne', - 'Seppe', 'Siebe', 'Simon', 'Sofia', 'Stan', 'Tess', 'Théo', 'Thomas', 'Tibo', 'Tom', 'Tristan', 'Tuur', 'Vic', 'Victor', 'Victoria', 'Vince', 'Warre', 'Wout', 'Xander', 'Yana', 'Yanis', + 'Aaron', 'Adam', 'Adrien', 'Alessio', 'Alexander', 'Alexandre', 'Alexia', 'Alexis', 'Alice', 'Alicia', 'Alyssa', 'Amber', 'Amélie', 'Amy', 'Anaïs', 'Anna', 'Anouk', 'Antoine', + 'Arne', 'Arthur', 'Axel', 'Axelle', 'Aya', 'Ayoub', 'Baptiste', 'Benjamin', 'Bo', 'Camille', 'Célia', 'Charlotte', 'Chiara', 'Chloé', 'Clara', 'Clémence', 'Clément', 'Daan', + 'David', 'Diego', 'Dylan', 'Elena', 'Elias', 'Eline', 'Elisa', 'Elise', 'Ella', 'Eloïse', 'Emiel', 'Emile', 'Emilie', 'Emma', 'Enzo', 'Estelle', 'Ethan', 'Eva', 'Febe', 'Femke', + 'Ferre', 'Fien', 'Finn', 'Fleur', 'Florian', 'Gabriel', 'Gilles', 'Giulia', 'Guillaume', 'Hajar', 'Hamza', 'Hanne', 'Helena', 'Hugo', 'Ilias', 'Ines', 'Inès', 'Jade', 'Jana', 'Janne', + 'Jarne', 'Jasper', 'Jeanne', 'Jelle', 'Jonas', 'Jules', 'Julia', 'Julie', 'Julien', 'Juliette', 'Kaat', 'Kato', 'Kobe', 'Lana', 'Lander', 'Lara', 'Lars', 'Laura', 'Laure', 'Léa', + 'Lena', 'Leon', 'Liam', 'Lien', 'Lilou', 'Lily', 'Lina', 'Linde', 'Lisa', 'Lise', 'Loïc', 'Lola', 'Lore', 'Lotte', 'Louis', 'Louise', 'Lowie', 'Luca', 'Lucas', 'Lucie', 'Lukas', + 'Luna', 'Maëlle', 'Malak', 'Manon', 'Margaux', 'Margot', 'Marie', 'Marion', 'Martin', 'Mathéo', 'Mathias', 'Mathis', 'Mathys', 'Mats', 'Matteo', 'Mauro', 'Maxim', 'Maxime', 'Maya', + 'Mehdi', 'Merel', 'Mila', 'Milan', 'Mohamed', 'Mohammed', 'Nathan', 'Nicolas', 'Niels', 'Nina', 'Noa', 'Noah', 'Noé', 'Noémie', 'Nolan', 'Noor', 'Nora', 'Nore', 'Océane', 'Olivia', + 'Pauline', 'Quinten', 'Rania', 'Raphaël', 'Rayan', 'Robbe', 'Robin', 'Romain', 'Romane', 'Roos', 'Ruben', 'Rune', 'Sacha', 'Salma', 'Sam', 'Samuel', 'Sander', 'Sara', 'Sarah', 'Senne', + 'Seppe', 'Siebe', 'Simon', 'Sofia', 'Stan', 'Tess', 'Théo', 'Thomas', 'Tibo', 'Tom', 'Tristan', 'Tuur', 'Vic', 'Victor', 'Victoria', 'Vince', 'Warre', 'Wout', 'Xander', 'Yana', 'Yanis', 'Yasmine', 'Zoé', 'Zoë' ); protected static $lastName = array( - 'Adam', 'Aerts', 'Amrani', 'André', 'Antoine', 'Baert', 'Bah', 'Barry', 'Bastin', 'Bauwens', 'Benali', 'Bernard', 'Bertrand', 'Bodart', 'Bogaert', 'Bogaerts', 'Borremans', 'Bosmans', - 'Boulanger', 'Bourgeois', 'Brasseur', 'Carlier', 'Celik', 'Ceulemans', 'Charlier', 'Christiaens', 'Claes', 'Claessens', 'Claeys', 'Collard', 'Collignon', 'Collin', 'Cools', 'Coppens', - 'Cornelis', 'Cornet', 'Cuvelier', 'Daems', 'De Backer', 'De Clercq', 'De Cock', 'De Coninck', 'De Coster', 'De Greef', 'De Groote', 'De Meyer', 'De Pauw', 'De Ridder', 'De Smedt', - 'De Smet', 'De Vos', 'De Wilde', 'De Winter', 'Declercq', 'Delfosse', 'Delhaye', 'Delvaux', 'Demir', 'Denis', 'Deprez', 'Descamps', 'Desmedt', 'Desmet', 'Dethier', 'Devos', 'Diallo', - 'Dierckx', 'Dogan', 'Dubois', 'Dumont', 'Dupont', 'El Amrani', 'Etienne', 'Evrard', 'Fontaine', 'François', 'Geerts', 'Georges', 'Gérard', 'Gielen', 'Gilles', 'Gillet', 'Gilson', - 'Goethals', 'Goffin', 'Goossens', 'Grégoire', 'Guillaume', 'Hajji', 'Hardy', 'Hendrickx', 'Henry', 'Herman', 'Hermans', 'Heylen', 'Heymans', 'Hubert', 'Jacob', 'Jacobs', 'Jacques', - 'Jacquet', 'Jansen', 'Janssen', 'Janssens', 'Kaya', 'Lacroix', 'Lambert', 'Lambrechts', 'Laurent', 'Lauwers', 'Lebrun', 'Leclercq', 'Lecocq', 'Lecomte', 'Lefebvre', 'Lefèvre', 'Legrand', - 'Lejeune', 'Lemaire', 'Lemmens', 'Lenaerts', 'Léonard', 'Leroy', 'Libert', 'Lievens', 'Louis', 'Luyten', 'Maes', 'Mahieu', 'Marchal', 'Maréchal', 'Martens', 'Martin', 'Massart', 'Masson', - 'Mathieu', 'Meert', 'Mertens', 'Messaoudi', 'Meunier', 'Michaux', 'Michel', 'Michiels', 'Moens', 'Moreau', 'Nguyen', 'Nicolas', 'Nijs', 'Noël', 'Parmentier', 'Pauwels', 'Peeters', 'Petit', - 'Pierre', 'Pieters', 'Piette', 'Piron', 'Pirotte', 'Poncelet', 'Raes', 'Remy', 'Renard', 'Robert', 'Roels', 'Roland', 'Rousseau', 'Sahin', 'Saidi', 'Schmitz', 'Segers', 'Servais', 'Simon', - 'Simons', 'Smet', 'Smets', 'Somers', 'Stevens', 'Thijs', 'Thiry', 'Thomas', 'Thys', 'Timmermans', 'Toussaint', 'Tran', 'Urbain', 'Van Acker', 'Van Damme', 'Van de Velde', 'Van den Bossche', - 'Van den Broeck', 'Van Dyck', 'Van Hecke', 'Van Hoof', 'Vandamme', 'Vandenberghe', 'Verbeeck', 'Verbeke', 'Verbruggen', 'Vercammen', 'Verhaegen', 'Verhaeghe', 'Verhelst', 'Verheyen', + 'Adam', 'Aerts', 'Amrani', 'André', 'Antoine', 'Baert', 'Bah', 'Barry', 'Bastin', 'Bauwens', 'Benali', 'Bernard', 'Bertrand', 'Bodart', 'Bogaert', 'Bogaerts', 'Borremans', 'Bosmans', + 'Boulanger', 'Bourgeois', 'Brasseur', 'Carlier', 'Celik', 'Ceulemans', 'Charlier', 'Christiaens', 'Claes', 'Claessens', 'Claeys', 'Collard', 'Collignon', 'Collin', 'Cools', 'Coppens', + 'Cornelis', 'Cornet', 'Cuvelier', 'Daems', 'De Backer', 'De Clercq', 'De Cock', 'De Coninck', 'De Coster', 'De Greef', 'De Groote', 'De Meyer', 'De Pauw', 'De Ridder', 'De Smedt', + 'De Smet', 'De Vos', 'De Wilde', 'De Winter', 'Declercq', 'Delfosse', 'Delhaye', 'Delvaux', 'Demir', 'Denis', 'Deprez', 'Descamps', 'Desmedt', 'Desmet', 'Dethier', 'Devos', 'Diallo', + 'Dierckx', 'Dogan', 'Dubois', 'Dumont', 'Dupont', 'El Amrani', 'Etienne', 'Evrard', 'Fontaine', 'François', 'Geerts', 'Georges', 'Gérard', 'Gielen', 'Gilles', 'Gillet', 'Gilson', + 'Goethals', 'Goffin', 'Goossens', 'Grégoire', 'Guillaume', 'Hajji', 'Hardy', 'Hendrickx', 'Henry', 'Herman', 'Hermans', 'Heylen', 'Heymans', 'Hubert', 'Jacob', 'Jacobs', 'Jacques', + 'Jacquet', 'Jansen', 'Janssen', 'Janssens', 'Kaya', 'Lacroix', 'Lambert', 'Lambrechts', 'Laurent', 'Lauwers', 'Lebrun', 'Leclercq', 'Lecocq', 'Lecomte', 'Lefebvre', 'Lefèvre', 'Legrand', + 'Lejeune', 'Lemaire', 'Lemmens', 'Lenaerts', 'Léonard', 'Leroy', 'Libert', 'Lievens', 'Louis', 'Luyten', 'Maes', 'Mahieu', 'Marchal', 'Maréchal', 'Martens', 'Martin', 'Massart', 'Masson', + 'Mathieu', 'Meert', 'Mertens', 'Messaoudi', 'Meunier', 'Michaux', 'Michel', 'Michiels', 'Moens', 'Moreau', 'Nguyen', 'Nicolas', 'Nijs', 'Noël', 'Parmentier', 'Pauwels', 'Peeters', 'Petit', + 'Pierre', 'Pieters', 'Piette', 'Piron', 'Pirotte', 'Poncelet', 'Raes', 'Remy', 'Renard', 'Robert', 'Roels', 'Roland', 'Rousseau', 'Sahin', 'Saidi', 'Schmitz', 'Segers', 'Servais', 'Simon', + 'Simons', 'Smet', 'Smets', 'Somers', 'Stevens', 'Thijs', 'Thiry', 'Thomas', 'Thys', 'Timmermans', 'Toussaint', 'Tran', 'Urbain', 'Van Acker', 'Van Damme', 'Van de Velde', 'Van den Bossche', + 'Van den Broeck', 'Van Dyck', 'Van Hecke', 'Van Hoof', 'Vandamme', 'Vandenberghe', 'Verbeeck', 'Verbeke', 'Verbruggen', 'Vercammen', 'Verhaegen', 'Verhaeghe', 'Verhelst', 'Verheyen', 'Verhoeven', 'Verlinden', 'Vermeersch', 'Vermeiren', 'Vermeulen', 'Verschueren', 'Verstraete', 'Verstraeten', 'Vervoort', 'Wauters', 'Willems', 'Wouters', 'Wuyts', 'Yildirim', 'Yilmaz' ); - private static $prefix = array('M.', 'Mme', 'Mlle', 'Dr', 'Pr', 'Me', 'Mgr'); + private static $prefix = array('M.', 'Mme', 'Mlle', 'Dr', 'Pr', 'Me', 'Mgr'); /** * Randomly returns a belgian prefix. - * + * * @example 'Mrs.' - * + * * @return string */ public static function prefix() diff --git a/src/Faker/Provider/fr_FR/Company.php b/src/Faker/Provider/fr_FR/Company.php index 0e4a7227..b00143c6 100644 --- a/src/Faker/Provider/fr_FR/Company.php +++ b/src/Faker/Provider/fr_FR/Company.php @@ -101,52 +101,52 @@ class Company extends \Faker\Provider\Company } /** - * Generates a siret number (14 digits) that passes the Luhn check. - * Use $maxSequentialDigits to make sure the digits at position 2 to 5 are not zeros. + * Generates a siret number (14 digits) that passes the Luhn check. + * Use $maxSequentialDigits to make sure the digits at position 2 to 5 are not zeros. * @see http://en.wikipedia.org/wiki/Luhn_algorithm - * @param int $maxSequentialDigits The maximum number of digits for the sequential number (> 0 && <= 4). + * @param int $maxSequentialDigits The maximum number of digits for the sequential number (> 0 && <= 4). * @return string */ public static function siret($maxSequentialDigits = 2) { - + if ($maxSequentialDigits > 4 || $maxSequentialDigits <= 0) { $maxSequentialDigits = 2; } - + $controlDigit = mt_rand(0, 9); $siret = $sum = $controlDigit; - + $position = 2; for ($i = 0; $i < $maxSequentialDigits; $i++) { - + $sequentialDigit = mt_rand(0, 9); $isEven = $position++ % 2 === 0; - + $tmp = $isEven ? $sequentialDigit * 2 : $sequentialDigit; if ($tmp >= 10) $tmp -= 9; $sum += $tmp; - + $siret = $sequentialDigit . $siret; - + } - + $siret = str_pad($siret, 5, '0', STR_PAD_LEFT); - + $position = 6; for ($i = 0; $i < 7; $i++) { - + $digit = mt_rand(0, 9); $isEven = $position++ % 2 === 0; - + $tmp = $isEven ? $digit * 2 : $digit; if ($tmp >= 10) $tmp -= 9; $sum += $tmp; - + $siret = $digit . $siret; - + } - + $mod = $sum % 10; if ($mod === 0) { $siret = '00' . $siret; @@ -154,13 +154,13 @@ class Company extends \Faker\Provider\Company // Use the odd position to avoid multiplying by two $siret = '0' . (10 - $mod) . $siret; } - + return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})/", "$1 $2 $3 $4", $siret); - + } /** - * Generates a siren number (9 digits) that passes the Luhn check. + * Generates a siren number (9 digits) that passes the Luhn check. * @see http://en.wikipedia.org/wiki/Luhn_algorithm * @return string */ @@ -169,27 +169,27 @@ class Company extends \Faker\Provider\Company $siren = ''; $sum = 0; for ($i = 9; $i > 1; $i--) { - + $digit = mt_rand(0, 9); $isEven = $i % 2 === 0; - + $tmp = $isEven ? $digit * 2 : $digit; if ($tmp >= 10) $tmp -= 9; $sum += $tmp; - + $siren = $digit . $siren; - + } - + $mod = $sum % 10; if ($mod === 0) { $siren = '0' . $siren; } else { $siren = (10 - $mod) . $siren; } - + return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{3})/", "$1 $2 $3", $siren); - + } /** diff --git a/src/Faker/Provider/hy_AM/Address.php b/src/Faker/Provider/hy_AM/Address.php index 0c1bd271..a8ebffcc 100644 --- a/src/Faker/Provider/hy_AM/Address.php +++ b/src/Faker/Provider/hy_AM/Address.php @@ -4,128 +4,129 @@ namespace Faker\Provider\hy_AM; class Address extends \Faker\Provider\Address { - protected static $cityPrefix = array('քաղաք','գյուղ'); + protected static $cityPrefix = array('քաղաք','գյուղ'); - protected static $regionSuffix = array('մարզ'); - protected static $streetPrefix = array('փողոց'); + protected static $regionSuffix = array('մարզ'); + protected static $streetPrefix = array('փողոց'); - protected static $buildingNumber = array('##'); - protected static $postcode = array('00##'); - protected static $country = array( - 'Մոնակո','Սինգապուր','Վատիկան','Մալդիվներ', - 'Մալթա','Բահրեյն','Բանգլադեշ','Բարբադոս', - 'Չինաստանի Հանրապետություն','Սան Մարինո', - 'Հարավային Կորեա','Նիդերլանդներ','Լիբանան', - 'Մարշալյան կղզիներ','Հնդկաստան','Կոմորներ', - 'Իսրայել','Բուրունդի','Հաիթի','Բելգիա','Ճապոնիա', - 'Ֆիլիպիններ','Շրի Լանկա','Գրենադա','Սալվադոր', - 'Վիետնամ','Ճամայկա','Անգլիա','Տրինիդադ և Տոբագո', - 'Գերմանիա','Պակիստան','Նեպալ','Դոմինիկանա', - 'Անտիգուա և Բարբուդա','Իտալիա','Լյուքսեմբուրգ', - 'Շվեյցարիա','Անդորրա','Նիգերիա','Գամբիա', - 'Քուվեյթ','Միկրոնեզիա','Ուգանդա','Չինաստան', - 'Թաիլանդ','Մալավի','Չեխիա','Մոլդովա','Դանիա', - 'Ինդոնեզիա','Գվատեմալա','Լեհաստան','Սիրիա', - 'Կիպրոս','Ֆրանսիա','Պորտուգալիա','Տոգո','Սլովակիա', - 'Հունգարիա','Ալբանիա','Կուբա','Գանա','Հայաստան', - 'Թուրքիա','Սլովենիա','Ավստրիա','Ադրբեջան', - 'Սերբիա','Ռումինիա','Իսպանիա','Բոսնիա և Հերցեգովինա', - 'Կոստա Ռիկա','Մալայզիա','Մակեդոնիա','Հունաստան', - 'Եգիպտոս','Կամբոջա','Բենին','Եթովպիա','Խորվաթիա', - 'Բիրմա','Սվազիլենդ','Արևելյան Թիմոր','Ուկրաինա', - 'Սիերա Լեոնե','Մարոկո','Հոնդուրաս','Հորդանան','Քենիա', - 'Բրունեյ','Իրաք','Վրաստան','Թունիս','Բուլղարիա', - 'Սենեգալ','Ուզբեկստան','Բուրկինա Ֆասո','Մեքսիկա', - 'Լիտվա','Տաջիկստան','Էկվադոր','Ֆիջի','Էրիթրեա','Իրան', - 'Բելառուս','Նիկարագուա','Աֆղանստան','Պալաու','Եմեն', - 'Տանզանիա','Պանամա','Գվինեա','Կամերուն', - 'Հարավային Աֆրիկա','Կոլումբիա','Մադագասկար', - 'Լատվիա','Լիբերիա','Կոնգո','Զիմբաբվե','Վենեսուելա', - 'Էստոնիա','Մոզամբիկ','Լաոս','Բրազիլիա','Պերու', - 'Բահամներ','Չիլի','Շվեդիա','Ուրուգվայ','Վանուատու', - 'Բութան','Զամբիա','Սուդան','Սոմալի','Նոր Զելանդիա', - 'Պարագվայ','Ֆինլանդիա','Արգենտինա','Ալժիր','Նորվեգիա', - 'Բելիզ','Հարավային Սուդան','Մալի','Անգոլա', - 'Թուրքմենստան','Օման','Բոլիվիա','Ռուսաստան','Գաբոն', - 'Ղազախստան','Լիբիա','Գայանա','Կանադա','Բոտսվանա', - 'Մավրիտանիա','Իսլանդիա','Սուրինամ','Ավստրալիա', - 'Նամիբիա','Մոնղոլիա', - ); + protected static $buildingNumber = array('##'); + protected static $postcode = array('00##'); + protected static $country = array( + 'Մոնակո','Սինգապուր','Վատիկան','Մալդիվներ', + 'Մալթա','Բահրեյն','Բանգլադեշ','Բարբադոս', + 'Չինաստանի Հանրապետություն','Սան Մարինո', + 'Հարավային Կորեա','Նիդերլանդներ','Լիբանան', + 'Մարշալյան կղզիներ','Հնդկաստան','Կոմորներ', + 'Իսրայել','Բուրունդի','Հաիթի','Բելգիա','Ճապոնիա', + 'Ֆիլիպիններ','Շրի Լանկա','Գրենադա','Սալվադոր', + 'Վիետնամ','Ճամայկա','Անգլիա','Տրինիդադ և Տոբագո', + 'Գերմանիա','Պակիստան','Նեպալ','Դոմինիկանա', + 'Անտիգուա և Բարբուդա','Իտալիա','Լյուքսեմբուրգ', + 'Շվեյցարիա','Անդորրա','Նիգերիա','Գամբիա', + 'Քուվեյթ','Միկրոնեզիա','Ուգանդա','Չինաստան', + 'Թաիլանդ','Մալավի','Չեխիա','Մոլդովա','Դանիա', + 'Ինդոնեզիա','Գվատեմալա','Լեհաստան','Սիրիա', + 'Կիպրոս','Ֆրանսիա','Պորտուգալիա','Տոգո','Սլովակիա', + 'Հունգարիա','Ալբանիա','Կուբա','Գանա','Հայաստան', + 'Թուրքիա','Սլովենիա','Ավստրիա','Ադրբեջան', + 'Սերբիա','Ռումինիա','Իսպանիա','Բոսնիա և Հերցեգովինա', + 'Կոստա Ռիկա','Մալայզիա','Մակեդոնիա','Հունաստան', + 'Եգիպտոս','Կամբոջա','Բենին','Եթովպիա','Խորվաթիա', + 'Բիրմա','Սվազիլենդ','Արևելյան Թիմոր','Ուկրաինա', + 'Սիերա Լեոնե','Մարոկո','Հոնդուրաս','Հորդանան','Քենիա', + 'Բրունեյ','Իրաք','Վրաստան','Թունիս','Բուլղարիա', + 'Սենեգալ','Ուզբեկստան','Բուրկինա Ֆասո','Մեքսիկա', + 'Լիտվա','Տաջիկստան','Էկվադոր','Ֆիջի','Էրիթրեա','Իրան', + 'Բելառուս','Նիկարագուա','Աֆղանստան','Պալաու','Եմեն', + 'Տանզանիա','Պանամա','Գվինեա','Կամերուն', + 'Հարավային Աֆրիկա','Կոլումբիա','Մադագասկար', + 'Լատվիա','Լիբերիա','Կոնգո','Զիմբաբվե','Վենեսուելա', + 'Էստոնիա','Մոզամբիկ','Լաոս','Բրազիլիա','Պերու', + 'Բահամներ','Չիլի','Շվեդիա','Ուրուգվայ','Վանուատու', + 'Բութան','Զամբիա','Սուդան','Սոմալի','Նոր Զելանդիա', + 'Պարագվայ','Ֆինլանդիա','Արգենտինա','Ալժիր','Նորվեգիա', + 'Բելիզ','Հարավային Սուդան','Մալի','Անգոլա', + 'Թուրքմենստան','Օման','Բոլիվիա','Ռուսաստան','Գաբոն', + 'Ղազախստան','Լիբիա','Գայանա','Կանադա','Բոտսվանա', + 'Մավրիտանիա','Իսլանդիա','Սուրինամ','Ավստրալիա', + 'Նամիբիա','Մոնղոլիա', + ); - protected static $region = array( - 'Արագածոտնի', 'Արարատի', 'Արմավիրի', - 'Գեղարքունիքի', 'Լոռու', 'Կոտայքի', 'Շիրակի', - 'Սյունիքի', 'Վայոց Ձորի', 'Տավուշի', - ); + protected static $region = array( + 'Արագածոտնի', 'Արարատի', 'Արմավիրի', + 'Գեղարքունիքի', 'Լոռու', 'Կոտայքի', 'Շիրակի', + 'Սյունիքի', 'Վայոց Ձորի', 'Տավուշի', + ); - protected static $city = array( - 'Աբովյան', 'Ագարակ', 'Ալավերդի', 'Ախթալա', 'Այրում', 'Աշտարակ', 'Ապարան', - 'Արարատ', 'Արթիկ', 'Արմավիր', 'Արտաշատ', 'Բերդ', 'Բյուրեղավան', 'Գավառ', - 'Գյումրի', 'Գորիս', 'Դաստակերտ', 'Դիլիջան', 'Եղեգնաձոր', 'Եղվարդ', 'Երևան', - 'Էջմիածին', 'Թալին', 'Թումանյան', 'Իջևան', 'Ծաղկաձոր', 'Կապան', 'Հրազդան', - 'Ճամբարակ', 'Մասիս', 'Մարալիկ', 'Մարտունի', 'Մեծամոր', 'Մեղրի', 'Նոր', - 'Նոյեմբերյան', 'Շամլուղ', 'Չարենցավան', 'Ջերմուկ', 'Սիսիան', 'Սպիտակ', - 'Ստեփանավան', 'Սևան', 'Վայք', 'Վանաձոր', 'Վարդենիս', 'Վեդի', 'Տաշիր', - 'Քաջարան', - ); + protected static $city = array( + 'Աբովյան', 'Ագարակ', 'Ալավերդի', 'Ախթալա', 'Այրում', 'Աշտարակ', 'Ապարան', + 'Արարատ', 'Արթիկ', 'Արմավիր', 'Արտաշատ', 'Բերդ', 'Բյուրեղավան', 'Գավառ', + 'Գյումրի', 'Գորիս', 'Դաստակերտ', 'Դիլիջան', 'Եղեգնաձոր', 'Եղվարդ', 'Երևան', + 'Էջմիածին', 'Թալին', 'Թումանյան', 'Իջևան', 'Ծաղկաձոր', 'Կապան', 'Հրազդան', + 'Ճամբարակ', 'Մասիս', 'Մարալիկ', 'Մարտունի', 'Մեծամոր', 'Մեղրի', 'Նոր', + 'Նոյեմբերյան', 'Շամլուղ', 'Չարենցավան', 'Ջերմուկ', 'Սիսիան', 'Սպիտակ', + 'Ստեփանավան', 'Սևան', 'Վայք', 'Վանաձոր', 'Վարդենիս', 'Վեդի', 'Տաշիր', + 'Քաջարան', + ); - protected static $street = array( - 'Պուշկին','Տերյան','Աբովյան','Ագաթանգեղոս','Անդրանիկ','Օտյան','Լուկաշին', - 'Տիչինա','Շինարարներ','Լենինգրադյան','Կիևյան', - ); + protected static $street = array( + 'Պուշկին','Տերյան','Աբովյան','Ագաթանգեղոս','Անդրանիկ','Օտյան','Լուկաշին', + 'Տիչինա','Շինարարներ','Լենինգրադյան','Կիևյան', + ); - protected static $addressFormats = array( - "{{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{buildingNumber}} {{streetPrefix}}, {{postcode}}", - ); + protected static $addressFormats = array( + "{{region}} {{regionSuffix}}, {{cityPrefix}} {{city}}, {{street}} {{buildingNumber}} {{streetPrefix}}, {{postcode}}", + ); - public static function buildingNumber() - { - return static::numerify(static::randomElement(static::$buildingNumber)); - } + public static function buildingNumber() + { + return static::numerify(static::randomElement(static::$buildingNumber)); + } - public function address() - { - $format = static::randomElement(static::$addressFormats); - return $this->generator->parse($format); - } + public function address() + { + $format = static::randomElement(static::$addressFormats); - public static function country() - { - return static::randomElement(static::$country); - } + return $this->generator->parse($format); + } - public static function postcode() - { - return static::toUpper(static::bothify(static::randomElement(static::$postcode))); - } + public static function country() + { + return static::randomElement(static::$country); + } - public static function regionSuffix() - { - return static::randomElement(static::$regionSuffix); - } + public static function postcode() + { + return static::toUpper(static::bothify(static::randomElement(static::$postcode))); + } - public static function region() - { - return static::randomElement(static::$region); - } + public static function regionSuffix() + { + return static::randomElement(static::$regionSuffix); + } - public static function cityPrefix() - { - return static::randomElement(static::$cityPrefix); - } + public static function region() + { + return static::randomElement(static::$region); + } - public function city() - { - return static::randomElement(static::$city); - } + public static function cityPrefix() + { + return static::randomElement(static::$cityPrefix); + } - public function streetPrefix() - { - return static::randomElement(static::$streetPrefix); - } + public function city() + { + return static::randomElement(static::$city); + } - public static function street() - { - return static::randomElement(static::$street); - } + public function streetPrefix() + { + return static::randomElement(static::$streetPrefix); + } + + public static function street() + { + return static::randomElement(static::$street); + } } diff --git a/src/Faker/Provider/hy_AM/Company.php b/src/Faker/Provider/hy_AM/Company.php index 5019b124..8ef3cce9 100644 --- a/src/Faker/Provider/hy_AM/Company.php +++ b/src/Faker/Provider/hy_AM/Company.php @@ -4,51 +4,51 @@ namespace Faker\Provider\hy_AM; class Company extends \Faker\Provider\Company { - protected static $formats = array( - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} {{companySuffix}}', - '{{lastName}} եղբայրներ', - ); + protected static $formats = array( + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} {{companySuffix}}', + '{{lastName}} եղբայրներ', + ); - protected static $catchPhraseWords = array( - - ); + protected static $catchPhraseWords = array( - protected static $bsWords = array( - - ); + ); - protected static $companySuffix = array('ՍՊԸ','և որդիներ','ՓԲԸ','ԲԲԸ'); + protected static $bsWords = array( - /** - * @example 'Robust full-range hub' - */ - public function catchPhrase() - { - $result = array(); - foreach (static::$catchPhraseWords as &$word) { - $result[] = static::randomElement($word); - } + ); - return join($result, ' '); - } + protected static $companySuffix = array('ՍՊԸ','և որդիներ','ՓԲԸ','ԲԲԸ'); - /** - * @example 'integrate extensible convergence' - */ - public function bs() - { - $result = array(); - foreach (static::$bsWords as &$word) { - $result[] = static::randomElement($word); - } + /** + * @example 'Robust full-range hub' + */ + public function catchPhrase() + { + $result = array(); + foreach (static::$catchPhraseWords as &$word) { + $result[] = static::randomElement($word); + } - return join($result, ' '); - } + return join($result, ' '); + } + + /** + * @example 'integrate extensible convergence' + */ + public function bs() + { + $result = array(); + foreach (static::$bsWords as &$word) { + $result[] = static::randomElement($word); + } + + return join($result, ' '); + } } diff --git a/src/Faker/Provider/hy_AM/Internet.php b/src/Faker/Provider/hy_AM/Internet.php index 558fc27e..46a78b8c 100644 --- a/src/Faker/Provider/hy_AM/Internet.php +++ b/src/Faker/Provider/hy_AM/Internet.php @@ -4,34 +4,35 @@ namespace Faker\Provider\hy_AM; class Internet extends \Faker\Provider\Internet { - protected static $tld = array('com', 'com', 'am', 'am', 'am', 'net', 'org', 'ru', 'am', 'am', 'am'); + protected static $tld = array('com', 'com', 'am', 'am', 'am', 'net', 'org', 'ru', 'am', 'am', 'am'); - /** - * @example 'jdoe' - */ - public function userName() - { - $format = static::randomElement(static::$userNameFormats); - return static::bothify($this->generator->parse($format)); - } + /** + * @example 'jdoe' + */ + public function userName() + { + $format = static::randomElement(static::$userNameFormats); - /** - * @example 'faber' - */ - public function domainWord() - { - $company = $this->generator->format('company'); - $companyElements = explode(' ', $company); - $company = $companyElements[0]; - $company = preg_replace('/,/', '', $company); - - // Translit for armenian language - $company = mb_strtolower($company, 'UTF-8'); - $company = str_replace( - array('ու','ա','բ','գ','դ','ե','զ','է','ը','թ','ժ','ի','լ','խ','ծ','կ','հ','ձ','ղ','ճ','մ','յ','ն','շ','ո','չ','պ','ջ','ռ','ս','վ','տ','ր','ց','փ','ք','և','օ','ֆ',), - array('u','a','b','g','d','e','z','e','y','t','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch','p','j','r','s','v','t','r','ts','p','q','ev','o','f'), - $company); - - return $company; - } + return static::bothify($this->generator->parse($format)); + } + + /** + * @example 'faber' + */ + public function domainWord() + { + $company = $this->generator->format('company'); + $companyElements = explode(' ', $company); + $company = $companyElements[0]; + $company = preg_replace('/,/', '', $company); + + // Translit for armenian language + $company = mb_strtolower($company, 'UTF-8'); + $company = str_replace( + array('ու','ա','բ','գ','դ','ե','զ','է','ը','թ','ժ','ի','լ','խ','ծ','կ','հ','ձ','ղ','ճ','մ','յ','ն','շ','ո','չ','պ','ջ','ռ','ս','վ','տ','ր','ց','փ','ք','և','օ','ֆ',), + array('u','a','b','g','d','e','z','e','y','t','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch','p','j','r','s','v','t','r','ts','p','q','ev','o','f'), + $company); + + return $company; + } } diff --git a/src/Faker/Provider/hy_AM/Person.php b/src/Faker/Provider/hy_AM/Person.php index 739ed1be..0fb1c719 100644 --- a/src/Faker/Provider/hy_AM/Person.php +++ b/src/Faker/Provider/hy_AM/Person.php @@ -4,70 +4,70 @@ namespace Faker\Provider\hy_AM; class Person extends \Faker\Provider\Person { - protected static $formats = array( - '{{firstName}} {{lastName}}', - '{{firstName}} {{lastName}}', - '{{firstName}} {{lastName}}', - '{{firstName}} {{lastName}}', - '{{firstName}} {{lastName}}', - ); + protected static $formats = array( + '{{firstName}} {{lastName}}', + '{{firstName}} {{lastName}}', + '{{firstName}} {{lastName}}', + '{{firstName}} {{lastName}}', + '{{firstName}} {{lastName}}', + ); - protected static $firstName = array( - 'Աբգար','Աբել','Աբրահամ','Ազատ','Ալբերտ','Ալեքս','Ահարոն', - 'Աղասի','Ալեքսանդր','Աղվան','Անդրանիկ','Անտոն','Անուշավան', - 'Աշոտ','Ասատուր','Ավետ','Ավետիս','Ավետիք','Ատոմ','Արա', - 'Արամ','Արամայիս','Արայիկ','Արարատ','Արգիշտի','Արեգ','Արթուր', - 'Արկադի','Արման','Արմեն','Արմենակ','Արշալույս','Արշակ','Արշավիր', - 'Արսեն','Արտակ','Արտաշես','Արտավազդ','Արտեմ', - 'Բաբգեն','Բագրատ','Բաղդասար','Բարսեղ','Գաբրիել','Գագիկ', - 'Գալուստ','Գառնիկ','Գասպար','Գարեգին','Գասևան','Գեղամ', - 'Գևորգ','Գնել','Գոռ','Գրիգոր','Գուրգեն','Դանիել','Դավիթ','Դերենիկ', - 'Եղիշե','Երվանդ','Զավեն','Էդգար','Էդուրադ','Էմիլ','Թաթուլ','Ժան', - 'Ժիրայր','Իշխան','Իսահակ','Լևոն','Խաչատուր','Խաչիկ','Խորեն', - 'Կարապետ','Կարեն','Հակոբ','Համբարձում','Համլետ','Հայկ', - 'Հարություն','Հենրիկ','Հմայակ','Հովիկ','Հովհաննես','Հովսեփ', - 'Հրայր','Հրանտ','Հրաչ','Մամիկոն','Մանվել','Մանուկ','Մարտին', - 'Մարիտորս','Մեսրոպ','Միհրան','Միհրդատ','Մինաս','Միսաք', - 'Միքայել','Մխիթար','Մկրտիչ','Մհեր','Մովսես','Մուշեղ','Մուրադ', - 'Նաիրի','Նարեկ','Նելսոն','Ներսես','Նվեր','Ոսկան','Պետրոս','Պողոս', - 'Ռազմիկ','Ռաֆայել','Ռոբերտ','Սամվել','Սարգիս','Սիմոն','Սոս','Ստեփան', - 'Սուրեն','Վազգեն','Վահագն','Վարդգես','Տիգրան','Ալվարդ','Ալինա', - 'Աղավնի','Անահիտ','Անգին','Անժելա','Անի','Աննա','Անուշ','Աշխեն', - 'Աստղիկ','Արևիկ','Արմենուհի','Արմինե','Գայանե','Գեղեցիկ','Գոհար', - 'Դիանա','Ելենա','Եվա','Զարուհի','Էմմա','Թագուհի','Ժաննա', - 'Իննա','Լենա','Լիզա','Լիլիթ','Լուսիկ','Կարինե','Համեստ','Հասմիկ', - 'Մագգա','Մարիամ','Մարինե','Մարո','Նազիկ','Նաիրա','Նարինե', - 'Նոննա','Նվարդ','Նվեր','Նունե','Շողիկ','Շուշանիկ','Ռուզաննա', - 'Սաթենիկ','Սառա','Սեդա','Սիլվա','Սոնա','Սոֆյա','Սրբուհի', - 'Սուսաննա','Վարդիթեր','Վարդուհի','Վիկտորյա','Տաթևիկ', - 'Քրիստինե','Օֆելյա','Ֆլորա', - ); + protected static $firstName = array( + 'Աբգար','Աբել','Աբրահամ','Ազատ','Ալբերտ','Ալեքս','Ահարոն', + 'Աղասի','Ալեքսանդր','Աղվան','Անդրանիկ','Անտոն','Անուշավան', + 'Աշոտ','Ասատուր','Ավետ','Ավետիս','Ավետիք','Ատոմ','Արա', + 'Արամ','Արամայիս','Արայիկ','Արարատ','Արգիշտի','Արեգ','Արթուր', + 'Արկադի','Արման','Արմեն','Արմենակ','Արշալույս','Արշակ','Արշավիր', + 'Արսեն','Արտակ','Արտաշես','Արտավազդ','Արտեմ', + 'Բաբգեն','Բագրատ','Բաղդասար','Բարսեղ','Գաբրիել','Գագիկ', + 'Գալուստ','Գառնիկ','Գասպար','Գարեգին','Գասևան','Գեղամ', + 'Գևորգ','Գնել','Գոռ','Գրիգոր','Գուրգեն','Դանիել','Դավիթ','Դերենիկ', + 'Եղիշե','Երվանդ','Զավեն','Էդգար','Էդուրադ','Էմիլ','Թաթուլ','Ժան', + 'Ժիրայր','Իշխան','Իսահակ','Լևոն','Խաչատուր','Խաչիկ','Խորեն', + 'Կարապետ','Կարեն','Հակոբ','Համբարձում','Համլետ','Հայկ', + 'Հարություն','Հենրիկ','Հմայակ','Հովիկ','Հովհաննես','Հովսեփ', + 'Հրայր','Հրանտ','Հրաչ','Մամիկոն','Մանվել','Մանուկ','Մարտին', + 'Մարիտորս','Մեսրոպ','Միհրան','Միհրդատ','Մինաս','Միսաք', + 'Միքայել','Մխիթար','Մկրտիչ','Մհեր','Մովսես','Մուշեղ','Մուրադ', + 'Նաիրի','Նարեկ','Նելսոն','Ներսես','Նվեր','Ոսկան','Պետրոս','Պողոս', + 'Ռազմիկ','Ռաֆայել','Ռոբերտ','Սամվել','Սարգիս','Սիմոն','Սոս','Ստեփան', + 'Սուրեն','Վազգեն','Վահագն','Վարդգես','Տիգրան','Ալվարդ','Ալինա', + 'Աղավնի','Անահիտ','Անգին','Անժելա','Անի','Աննա','Անուշ','Աշխեն', + 'Աստղիկ','Արևիկ','Արմենուհի','Արմինե','Գայանե','Գեղեցիկ','Գոհար', + 'Դիանա','Ելենա','Եվա','Զարուհի','Էմմա','Թագուհի','Ժաննա', + 'Իննա','Լենա','Լիզա','Լիլիթ','Լուսիկ','Կարինե','Համեստ','Հասմիկ', + 'Մագգա','Մարիամ','Մարինե','Մարո','Նազիկ','Նաիրա','Նարինե', + 'Նոննա','Նվարդ','Նվեր','Նունե','Շողիկ','Շուշանիկ','Ռուզաննա', + 'Սաթենիկ','Սառա','Սեդա','Սիլվա','Սոնա','Սոֆյա','Սրբուհի', + 'Սուսաննա','Վարդիթեր','Վարդուհի','Վիկտորյա','Տաթևիկ', + 'Քրիստինե','Օֆելյա','Ֆլորա', + ); - protected static $lastName = array( - 'Կարապետյան','Ասատրյան','Հովսեփյան','Մուրադյան','Հովհաննիսյան', - 'Աբգարյան','Գրիգորյան','Կարապետյան','Հայրապետյան','Ավագյան', - 'Պետրոսյան','Պողոսյան','Աբդալյան','Բադալյան','Մելիքյան','Մկրտչյան', - 'Դարբինյան','Կիրակոսյան','Հակոբյան','Խաչատրյան','Վարդանյան', - 'Համբարձումյան','Սարգսյան', - ); + protected static $lastName = array( + 'Կարապետյան','Ասատրյան','Հովսեփյան','Մուրադյան','Հովհաննիսյան', + 'Աբգարյան','Գրիգորյան','Կարապետյան','Հայրապետյան','Ավագյան', + 'Պետրոսյան','Պողոսյան','Աբդալյան','Բադալյան','Մելիքյան','Մկրտչյան', + 'Դարբինյան','Կիրակոսյան','Հակոբյան','Խաչատրյան','Վարդանյան', + 'Համբարձումյան','Սարգսյան', + ); - private static $prefix = array('Պարոն',''); + private static $prefix = array('Պարոն',''); - private static $suffix = array('',); + private static $suffix = array('',); - /** - * @example 'Mrs.' - */ - public static function prefix() - { - return static::randomElement(static::$prefix); - } + /** + * @example 'Mrs.' + */ + public static function prefix() + { + return static::randomElement(static::$prefix); + } - /** - * @example 'PhD' - */ - public static function suffix() - { - return static::randomElement(static::$suffix); - } -} \ No newline at end of file + /** + * @example 'PhD' + */ + public static function suffix() + { + return static::randomElement(static::$suffix); + } +} diff --git a/src/Faker/Provider/hy_AM/PhoneNumber.php b/src/Faker/Provider/hy_AM/PhoneNumber.php index d6c7f9d2..04278fa9 100644 --- a/src/Faker/Provider/hy_AM/PhoneNumber.php +++ b/src/Faker/Provider/hy_AM/PhoneNumber.php @@ -4,34 +4,34 @@ namespace Faker\Provider\hy_AM; class PhoneNumber extends \Faker\Provider\PhoneNumber { - protected static $formats = array( - '093 ######', - '093 ##-##-##', - '(093) ######', - '(093) ##-##-##', - '094 ######', - '094 ##-##-##', - '(094) ######', - '(094) ##-##-##', - '095 ######', - '095 ##-##-##', - '(095) ######', - '(095) ##-##-##', - '096 ######', - '096 ##-##-##', - '(096) ######', - '(096) ##-##-##', - '099 ######', - '099 ##-##-##', - '(099) ######', - '(099) ##-##-##', - '077 ######', - '077 ##-##-##', - '(077) ######', - '(077) ##-##-##', - '055 ######', - '055 ##-##-##', - '(055) ######', - '(055) ##-##-##', - ); + protected static $formats = array( + '093 ######', + '093 ##-##-##', + '(093) ######', + '(093) ##-##-##', + '094 ######', + '094 ##-##-##', + '(094) ######', + '(094) ##-##-##', + '095 ######', + '095 ##-##-##', + '(095) ######', + '(095) ##-##-##', + '096 ######', + '096 ##-##-##', + '(096) ######', + '(096) ##-##-##', + '099 ######', + '099 ##-##-##', + '(099) ######', + '(099) ##-##-##', + '077 ######', + '077 ##-##-##', + '(077) ######', + '(077) ##-##-##', + '055 ######', + '055 ##-##-##', + '(055) ######', + '(055) ##-##-##', + ); } diff --git a/src/Faker/Provider/is_IS/Person.php b/src/Faker/Provider/is_IS/Person.php index cc82b3f5..e9b49fed 100644 --- a/src/Faker/Provider/is_IS/Person.php +++ b/src/Faker/Provider/is_IS/Person.php @@ -80,13 +80,11 @@ class Person extends \Faker\Provider\Person { $name = static::firstNameMan(); - if (substr($name, -2) === 'ur') - { + if (substr($name, -2) === 'ur') { $name = substr($name, 0, strlen($name) - 2); } - if (substr($name, -1) !== 's') - { + if (substr($name, -1) !== 's') { $name .= 's'; } @@ -134,8 +132,7 @@ class Person extends \Faker\Provider\Person // valid flag $valid = FALSE; - while ( ! $valid) - { + while (! $valid) { // make two random numbers $rand = static::randomDigit().static::randomDigit(); @@ -143,8 +140,7 @@ class Person extends \Faker\Provider\Person $tmp = $birthdate->format('dmy').$rand; // loop through temp string - for ($i = 7, $sum = 0; $i >= 0; $i--) - { + for ($i = 7, $sum = 0; $i >= 0; $i--) { // calculate security variable $sum += ($tmp[$i] * $ref[$i]); } @@ -152,8 +148,7 @@ class Person extends \Faker\Provider\Person // subtract 11 if not 11 $chk = ($sum % 11 === 0) ? 0 : (11 - ($sum % 11)); - if ($chk < 10) - { + if ($chk < 10) { $lastFour = $rand.$chk.substr($birthdate->format('Y'), 1, 1); $valid = TRUE; diff --git a/src/Faker/Provider/nl_NL/Person.php b/src/Faker/Provider/nl_NL/Person.php index 052984ee..339732cd 100644 --- a/src/Faker/Provider/nl_NL/Person.php +++ b/src/Faker/Provider/nl_NL/Person.php @@ -40,7 +40,6 @@ class Person extends \Faker\Provider\Person 'Verbeek' ); - protected static $dutchLastNames = array( 'Aalts', 'Aarden', 'Aarts', 'Adelaar', 'Adriaansen', 'Adriaensdr', 'Adriaense', 'Adryaens', 'Aeije', 'Aelftrud van Wessex', 'Aertsz', 'van Alenburg', 'van Allemanië', 'Alpaidis', 'Amalrada', 'van Amstel', @@ -165,8 +164,6 @@ class Person extends \Faker\Provider\Person 'Zijlmans', 'Zuidweg', 'Zuijdveld', 'van Zwaben', 'Zwart', 'Zwijsen' ); - - protected static $commonForeignLastNames = array( 'Yilmaz', 'Nguyen', 'Ali', 'Mohamed', 'Yildiz', 'Yildirim', 'Öztürk', 'Demir', 'Hassan', 'Şahin', 'Aydin', 'Özdemir', 'Çelik', 'Kiliç', 'Arslan', 'Dogan', 'Tran', 'Abdi', 'Aslan', 'Hussein', 'Koç', 'Özcan', 'Hussain', @@ -285,7 +282,6 @@ class Person extends \Faker\Provider\Person return $lastName; } - /** * @example 'mr.' */ @@ -301,4 +297,4 @@ class Person extends \Faker\Provider\Person { return static::randomElement(static::$suffix); } -} \ No newline at end of file +} diff --git a/src/Faker/Provider/ru_RU/Address.php b/src/Faker/Provider/ru_RU/Address.php index dea79b3c..0f2c3cf2 100644 --- a/src/Faker/Provider/ru_RU/Address.php +++ b/src/Faker/Provider/ru_RU/Address.php @@ -91,7 +91,7 @@ class Address extends \Faker\Provider\Base protected static $street = array( 'Косиора', 'Ладыгина', 'Ленина', 'Ломоносова', 'Домодедовская', 'Гоголя', '1905 года', 'Чехова', 'Сталина', - 'Космонавтов', 'Гагарина', 'Славы', 'Бухарестская', 'Будапештсткая', 'Балканская' + 'Космонавтов', 'Гагарина', 'Славы', 'Бухарестская', 'Будапештсткая', 'Балканская' ); protected static $addressFormats = array( diff --git a/src/Faker/Provider/ru_RU/Person.php b/src/Faker/Provider/ru_RU/Person.php index 99e4168d..ef020350 100644 --- a/src/Faker/Provider/ru_RU/Person.php +++ b/src/Faker/Provider/ru_RU/Person.php @@ -34,7 +34,7 @@ class Person extends \Faker\Provider\Person protected static $middleName = array( 'Александрович', 'Алексеевич', 'Андреевич', 'Дмитриевич', 'Евгеньевич', 'Сергеевич', 'Иванович', 'Фёдорович', 'Львович', 'Романович', 'Владимирович', - 'Борисович', 'Максимович', + 'Борисович', 'Максимович', ); /** diff --git a/src/Faker/Provider/ua_UA/Address.php b/src/Faker/Provider/ua_UA/Address.php index 152badce..3f2487b3 100644 --- a/src/Faker/Provider/ua_UA/Address.php +++ b/src/Faker/Provider/ua_UA/Address.php @@ -334,6 +334,7 @@ class Address extends \Faker\Provider\Address $region = static::$region[$regionAndCityNumber]; $city = static::$city[$regionAndCityNumber]; $format = "$region {{regionSuffix}}, {{cityPrefix}} $city"; + return $this->generator->parse($format); } diff --git a/src/Faker/Provider/ua_UA/Company.php b/src/Faker/Provider/ua_UA/Company.php index 909252cd..332e156a 100644 --- a/src/Faker/Provider/ua_UA/Company.php +++ b/src/Faker/Provider/ua_UA/Company.php @@ -28,6 +28,7 @@ class Company extends \Faker\Provider\Company public function companyUrl() { $format = static::randomElement(static::$urlFormats); + return $this->generator->parse($format); } diff --git a/src/Faker/Provider/ua_UA/Internet.php b/src/Faker/Provider/ua_UA/Internet.php index 79bc23fd..966a5a2d 100644 --- a/src/Faker/Provider/ua_UA/Internet.php +++ b/src/Faker/Provider/ua_UA/Internet.php @@ -13,6 +13,7 @@ class Internet extends \Faker\Provider\Internet public function userName() { $format = static::randomElement(static::$userNameFormats); + return static::toLower(static::bothify( Transliteration::transliterate($this->generator->parse($format)) ) @@ -27,6 +28,7 @@ class Internet extends \Faker\Provider\Internet $company = $this->generator->format('companyUrl'); $company = str_replace(' ', '-', $company); $company = Transliteration::transliterate($company); + return $company; } } diff --git a/src/Faker/Provider/ua_UA/Transliteration.php b/src/Faker/Provider/ua_UA/Transliteration.php index 2cd4d65a..b72cf779 100644 --- a/src/Faker/Provider/ua_UA/Transliteration.php +++ b/src/Faker/Provider/ua_UA/Transliteration.php @@ -10,10 +10,11 @@ Class Transliteration /** * Translate cyrillic text to latin * Useful for URL ang email generation - * @param string $string + * @param string $string * @return string */ - public static function transliterate($string = '') { + public static function transliterate($string = '') + { $replace=array( "'"=>"", "`"=>"", @@ -53,6 +54,7 @@ Class Transliteration "ї"=>"yi","Ї"=>"yi", "є"=>"e","Є"=>"e" ); + return strtr($string, $replace); } -} \ No newline at end of file +} diff --git a/test/Faker/PHPUnit/Framework/Constraint/IsValidSiren.php b/test/Faker/PHPUnit/Framework/Constraint/IsValidSiren.php index b41930ac..d1502d01 100644 --- a/test/Faker/PHPUnit/Framework/Constraint/IsValidSiren.php +++ b/test/Faker/PHPUnit/Framework/Constraint/IsValidSiren.php @@ -4,13 +4,15 @@ namespace Faker\PHPUnit\Framework\Constraint; class IsValidSiren extends IsValidSirenSiret { - - protected function getLength() { - return 9; - } - - protected function getName() { - return 'SIREN'; - } - -} \ No newline at end of file + + protected function getLength() + { + return 9; + } + + protected function getName() + { + return 'SIREN'; + } + +} diff --git a/test/Faker/PHPUnit/Framework/Constraint/IsValidSirenSiret.php b/test/Faker/PHPUnit/Framework/Constraint/IsValidSirenSiret.php index c818e843..b473f25a 100644 --- a/test/Faker/PHPUnit/Framework/Constraint/IsValidSirenSiret.php +++ b/test/Faker/PHPUnit/Framework/Constraint/IsValidSirenSiret.php @@ -1,36 +1,38 @@ -getLength()) - return false; - $sum = 0; - // IMPORTANT : from right to left - $position = 1; - for ($i = strlen($code) - 1; $i >= 0; $i--) { - $isEven = (($position++ % 2) === 0); - $tmp = $isEven ? $code[$i] * 2 : $code[$i]; - if ($tmp >= 10) $tmp -= 9; - $sum += $tmp; - } - return ($sum % 10 === 0); - + $code = str_replace(' ', '', $other); + + if (strlen($code) != $this->getLength()) + return false; + + $sum = 0; + // IMPORTANT : from right to left + $position = 1; + for ($i = strlen($code) - 1; $i >= 0; $i--) { + $isEven = (($position++ % 2) === 0); + $tmp = $isEven ? $code[$i] * 2 : $code[$i]; + if ($tmp >= 10) $tmp -= 9; + $sum += $tmp; + } + + return ($sum % 10 === 0); + } - - public function toString() { - return sprintf('is a valid %s number', $this->getName()); + + public function toString() + { + return sprintf('is a valid %s number', $this->getName()); } - + abstract protected function getLength(); - + abstract protected function getName(); - -} \ No newline at end of file + +} diff --git a/test/Faker/PHPUnit/Framework/Constraint/IsValidSiret.php b/test/Faker/PHPUnit/Framework/Constraint/IsValidSiret.php index 54da7b74..4725fbec 100644 --- a/test/Faker/PHPUnit/Framework/Constraint/IsValidSiret.php +++ b/test/Faker/PHPUnit/Framework/Constraint/IsValidSiret.php @@ -4,13 +4,15 @@ namespace Faker\PHPUnit\Framework\Constraint; class IsValidSiret extends IsValidSirenSiret { - - protected function getLength() { - return 14; - } - - protected function getName() { - return 'SIRET'; - } - -} \ No newline at end of file + + protected function getLength() + { + return 14; + } + + protected function getName() + { + return 'SIRET'; + } + +} diff --git a/test/Faker/Provider/BaseTest.php b/test/Faker/Provider/BaseTest.php index 0cff9c70..60aff679 100644 --- a/test/Faker/Provider/BaseTest.php +++ b/test/Faker/Provider/BaseTest.php @@ -57,17 +57,17 @@ class BaseTest extends \PHPUnit_Framework_TestCase $min = 4; $max = 10; $nbMaxDecimals = 8; - + $result = BaseProvider::randomFloat($nbMaxDecimals, $min, $max); - + $parts = explode('.', $result); - + $this->assertInternalType('float', $result); $this->assertGreaterThanOrEqual($min, $result); $this->assertLessThanOrEqual($max, $result); $this->assertLessThanOrEqual($nbMaxDecimals, strlen($parts[1])); } - + public function testRandomLetterReturnsString() { $this->assertTrue(is_string(BaseProvider::randomLetter())); diff --git a/test/Faker/Provider/ColorTest.php b/test/Faker/Provider/ColorTest.php index 4f20ef34..3393b674 100644 --- a/test/Faker/Provider/ColorTest.php +++ b/test/Faker/Provider/ColorTest.php @@ -7,26 +7,26 @@ use Faker\Provider\Color; class ColorTest extends \PHPUnit_Framework_TestCase { - public function testHexColor() - { - $this->assertRegExp('/^#[a-f0-9]{6}$/i', Color::hexColor()); - } + public function testHexColor() + { + $this->assertRegExp('/^#[a-f0-9]{6}$/i', Color::hexColor()); + } - public function testRgbColorAsArray() - { - $this->assertEquals(3, count(Color::rgbColorAsArray())); - } + public function testRgbColorAsArray() + { + $this->assertEquals(3, count(Color::rgbColorAsArray())); + } - public function testRgbColor() - { - $regexp = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'; - $this->assertRegExp('/^' . $regexp . ',' . $regexp . ',' . $regexp . '$/i', Color::rgbColor()); - } + public function testRgbColor() + { + $regexp = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'; + $this->assertRegExp('/^' . $regexp . ',' . $regexp . ',' . $regexp . '$/i', Color::rgbColor()); + } - public function testRgbCssColor() - { - $regexp = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'; - $this->assertRegExp('/^rgb\(' . $regexp . ',' . $regexp . ',' . $regexp . '\)$/i', Color::rgbCssColor()); - } + public function testRgbCssColor() + { + $regexp = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'; + $this->assertRegExp('/^rgb\(' . $regexp . ',' . $regexp . ',' . $regexp . '\)$/i', Color::rgbCssColor()); + } -} \ No newline at end of file +} diff --git a/test/Faker/Provider/ProviderOverrideTest.php b/test/Faker/Provider/ProviderOverrideTest.php index 68e30c45..43e46dc2 100644 --- a/test/Faker/Provider/ProviderOverrideTest.php +++ b/test/Faker/Provider/ProviderOverrideTest.php @@ -127,7 +127,7 @@ class ProviderOverrideTest extends \PHPUnit_Framework_TestCase /** * @dataProvider localeDataProvider * - * @param null $locale + * @param null $locale * @param string $locale */ public function testUuid($locale = null) diff --git a/test/Faker/Provider/fr_FR/CompanyTest.php b/test/Faker/Provider/fr_FR/CompanyTest.php index c3e6f3d5..de8d8ab6 100644 --- a/test/Faker/Provider/fr_FR/CompanyTest.php +++ b/test/Faker/Provider/fr_FR/CompanyTest.php @@ -11,16 +11,16 @@ class CompanyTest extends \PHPUnit_Framework_TestCase { return new Constraint\IsValidSiret(); } - + private static function isValidSiren() { return new Constraint\IsValidSiren(); } - + public function testParagraphWithNegativeNbDigitsReturnsAWellFormattedSiret() { $siret = Company::siret(-1); - + $this->assertThat($siret, self::isValidSiret()); $this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} 00[\d]{3}/", $siret); } @@ -28,7 +28,7 @@ class CompanyTest extends \PHPUnit_Framework_TestCase public function testParagraphWithInvalidNbDigitsReturnsAWellFormattedSiret() { $siret = Company::siret(6); - + $this->assertThat($siret, self::isValidSiret()); $this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} 00[\d]{3}/", $siret); } @@ -39,7 +39,7 @@ class CompanyTest extends \PHPUnit_Framework_TestCase $siret2 = Company::siret(2); $siret3 = Company::siret(3); $siret4 = Company::siret(4); - + $this->assertThat($siret1, self :: isValidSiret()); $this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} 000[\d]{2}/", $siret1); $this->assertThat($siret2, self :: isValidSiret()); @@ -49,11 +49,11 @@ class CompanyTest extends \PHPUnit_Framework_TestCase $this->assertThat($siret4, self :: isValidSiret()); $this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} [\d]{5}/", $siret4); } - + public function testSirenReturnsAValidAndWellFormattedSiren() { $siret = Company::siren(); - + $this->assertThat($siret, self :: isValidSiren()); $this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3}/", $siret); } @@ -79,4 +79,4 @@ class TestableCompany extends Company { return parent::isCatchPhraseValid($catchPhrase); } -} \ No newline at end of file +}