1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-04-19 23:12:01 +02:00

Merge pull request #1962 from pimjansen/feature/psr12

Migrated Faker to match PSR12 instead of PSR2
This commit is contained in:
Andreas Möller 2020-03-15 17:58:22 +01:00 committed by GitHub
commit a88ae83a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 175 additions and 167 deletions

View File

@ -4,7 +4,7 @@
<file>src/</file>
<rule ref="PSR2" />
<rule ref="PSR12" />
<arg value="n" />
</ruleset>

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Calculator;
class Inn
@ -16,7 +17,7 @@ class Inn
$multipliers = array(1 => 2, 2 => 4, 3 => 10, 4 => 3, 5 => 5, 6 => 9, 7 => 4, 8 => 6, 9 => 8);
$sum = 0;
for ($i = 1; $i <= 9; $i++) {
$sum += intval(substr($inn, $i-1, 1)) * $multipliers[$i];
$sum += intval(substr($inn, $i - 1, 1)) * $multipliers[$i];
}
return strval(($sum % 11) % 10);
}

View File

@ -21,7 +21,7 @@ class Documentor
{
$formatters = array();
$providers = array_reverse($this->generator->getProviders());
$providers[]= new Provider\Base($this->generator);
$providers[] = new Provider\Base($this->generator);
foreach ($providers as $provider) {
$providerClass = get_class($provider);
$formatters[$providerClass] = array();
@ -36,20 +36,20 @@ class Documentor
}
$parameters = array();
foreach ($reflmethod->getParameters() as $reflparameter) {
$parameter = '$'. $reflparameter->getName();
$parameter = '$' . $reflparameter->getName();
if ($reflparameter->isDefaultValueAvailable()) {
$parameter .= ' = ' . var_export($reflparameter->getDefaultValue(), true);
}
$parameters []= $parameter;
$parameters [] = $parameter;
}
$parameters = $parameters ? '('. join(', ', $parameters) . ')' : '';
$parameters = $parameters ? '(' . join(', ', $parameters) . ')' : '';
try {
$example = $this->generator->format($methodName);
} catch (\InvalidArgumentException $e) {
$example = '';
}
if (is_array($example)) {
$example = "array('". join("', '", $example) . "')";
$example = "array('" . join("', '", $example) . "')";
} elseif ($example instanceof \DateTime) {
$example = "DateTime('" . $example->format('Y-m-d H:i:s') . "')";
} elseif ($example instanceof Generator || $example instanceof UniqueGenerator) { // modifier

View File

@ -2,7 +2,7 @@
namespace Faker\Guesser;
use \Faker\Provider\Base;
use Faker\Provider\Base;
class Name
{

View File

@ -61,7 +61,7 @@ class Barcode extends Base
$result = (11 - array_sum($digits) % 11) % 11;
// 10 is replaced by X
return ($result < 10)?$result:'X';
return ($result < 10) ? $result : 'X';
}
/**

View File

@ -305,9 +305,9 @@ class Base
$j = mt_rand(0, $i);
}
if ($j == $i) {
$shuffledArray[]= $value;
$shuffledArray[] = $value;
} else {
$shuffledArray[]= $shuffledArray[$j];
$shuffledArray[] = $shuffledArray[$j];
$shuffledArray[$j] = $value;
}
$i++;
@ -339,7 +339,7 @@ class Base
$array = array();
$strlen = mb_strlen($string, $encoding);
for ($i = 0; $i < $strlen; $i++) {
$array []= mb_substr($string, $i, 1, $encoding);
$array [] = mb_substr($string, $i, 1, $encoding);
}
} else {
$array = str_split($string, 1);

View File

@ -68,7 +68,7 @@ class DateTime extends Base
*/
public static function dateTimeAD($max = 'now', $timezone = null)
{
$min = (PHP_INT_SIZE>4 ? -62135597361 : -PHP_INT_MAX);
$min = (PHP_INT_SIZE > 4 ? -62135597361 : -PHP_INT_MAX);
return static::setTimezone(
new \DateTime('@' . mt_rand($min, static::getMaxTimestamp($max))),
$timezone
@ -163,7 +163,7 @@ class DateTime extends Base
$otherDatetime->add($intervalObject);
$begin = $datetime > $otherDatetime ? $otherDatetime : $datetime;
$end = $datetime===$begin ? $otherDatetime : $datetime;
$end = $datetime === $begin ? $otherDatetime : $datetime;
return static::dateTimeBetween(
$begin,

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider;
class File extends Base

View File

@ -72,7 +72,7 @@ class Image extends Base
// Generate a random filename. Use the server address so that a file
// generated at the same time on a different server won't have a collision.
$name = md5(uniqid(empty($_SERVER['SERVER_ADDR']) ? '' : $_SERVER['SERVER_ADDR'], true));
$filename = $name .'.jpg';
$filename = $name . '.jpg';
$filepath = $dir . DIRECTORY_SEPARATOR . $filename;
$url = static::imageUrl($width, $height, $category, $randomize, $word, $gray);

View File

@ -192,8 +192,8 @@ class Internet extends Base
public function ipv6()
{
$res = array();
for ($i=0; $i < 8; $i++) {
$res []= dechex(mt_rand(0, "65535"));
for ($i = 0; $i < 8; $i++) {
$res [] = dechex(mt_rand(0, "65535"));
}
return join(':', $res);
@ -218,7 +218,7 @@ class Internet extends Base
*/
public static function macAddress()
{
for ($i=0; $i<6; $i++) {
for ($i = 0; $i < 6; $i++) {
$mac[] = sprintf('%02X', static::numberBetween(0, 0xff));
}
$mac = implode(':', $mac);
@ -248,110 +248,110 @@ class Internet extends Base
if (empty($arrayFrom)) {
$transliterationTable = array(
'IJ'=>'I', 'Ö'=>'O', 'Œ'=>'O', 'Ü'=>'U', 'ä'=>'a', 'æ'=>'a',
'ij'=>'i', 'ö'=>'o', 'œ'=>'o', 'ü'=>'u', 'ß'=>'s', 'ſ'=>'s',
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A',
'Æ'=>'A', 'Ā'=>'A', 'Ą'=>'A', 'Ă'=>'A', 'Ç'=>'C', 'Ć'=>'C',
'Č'=>'C', 'Ĉ'=>'C', 'Ċ'=>'C', 'Ď'=>'D', 'Đ'=>'D', 'È'=>'E',
'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ē'=>'E', 'Ę'=>'E', 'Ě'=>'E',
'Ĕ'=>'E', 'Ė'=>'E', 'Ĝ'=>'G', 'Ğ'=>'G', 'Ġ'=>'G', 'Ģ'=>'G',
'Ĥ'=>'H', 'Ħ'=>'H', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I',
'Ī'=>'I', 'Ĩ'=>'I', 'Ĭ'=>'I', 'Į'=>'I', 'İ'=>'I', 'Ĵ'=>'J',
'Ķ'=>'K', 'Ľ'=>'K', 'Ĺ'=>'K', 'Ļ'=>'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'о'=>'O', 'п'=>'P', 'р'=>'R',
'с'=>'S', 'т'=>'T', 'у'=>'U', 'ф'=>'F', 'х'=>'K', 'ц'=>'T',
'ч'=>'C', 'ш'=>'S', 'щ'=>'S', 'ы'=>'Y', 'э'=>'E', 'ю'=>'Y',
'я'=>'Y', 'ð'=>'d', 'Ð'=>'D', 'þ'=>'t', 'Þ'=>'T', 'ა'=>'a',
'ბ'=>'b', 'გ'=>'g', 'დ'=>'d', 'ე'=>'e', 'ვ'=>'v', 'ზ'=>'z',
'თ'=>'t', 'ი'=>'i', 'კ'=>'k', 'ლ'=>'l', 'მ'=>'m', 'ნ'=>'n',
'ო'=>'o', 'პ'=>'p', 'ჟ'=>'z', 'რ'=>'r', 'ს'=>'s', 'ტ'=>'t',
'უ'=>'u', 'ფ'=>'p', 'ქ'=>'k', 'ღ'=>'g', ''=>'q', 'შ'=>'s',
'ჩ'=>'c', 'ც'=>'t', 'ძ'=>'d', 'წ'=>'t', 'ჭ'=>'c', 'ხ'=>'k',
'ჯ'=>'j', 'ჰ'=>'h', 'ţ'=>'t', 'ʼ'=>"'", '̧'=>'', 'ḩ'=>'h',
''=>"'", ''=>"'", 'ừ'=>'u', '/'=>'', 'ế'=>'e', 'ả'=>'a',
'ị'=>'i', 'ậ'=>'a', 'ệ'=>'e', 'ỉ'=>'i', 'ồ'=>'o', 'ề'=>'e',
'ơ'=>'o', 'ạ'=>'a', 'ẵ'=>'a', 'ư'=>'u', 'ằ'=>'a', 'ầ'=>'a',
'ḑ'=>'d', 'Ḩ'=>'H', 'Ḑ'=>'D', 'ș'=>'s', 'ț'=>'t', 'ộ'=>'o',
'ắ'=>'a', 'ş'=>'s', "'"=>'', 'ու'=>'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',
'IJ' => 'I', 'Ö' => 'O', 'Œ' => 'O', 'Ü' => 'U', 'ä' => 'a', 'æ' => 'a',
'ij' => 'i', 'ö' => 'o', 'œ' => 'o', 'ü' => 'u', 'ß' => 's', 'ſ' => 's',
'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A',
'Æ' => 'A', 'Ā' => 'A', 'Ą' => 'A', 'Ă' => 'A', 'Ç' => 'C', 'Ć' => 'C',
'Č' => 'C', 'Ĉ' => 'C', 'Ċ' => 'C', 'Ď' => 'D', 'Đ' => 'D', 'È' => 'E',
'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ē' => 'E', 'Ę' => 'E', 'Ě' => 'E',
'Ĕ' => 'E', 'Ė' => 'E', 'Ĝ' => 'G', 'Ğ' => 'G', 'Ġ' => 'G', 'Ģ' => 'G',
'Ĥ' => 'H', 'Ħ' => 'H', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',
'Ī' => 'I', 'Ĩ' => 'I', 'Ĭ' => 'I', 'Į' => 'I', 'İ' => 'I', 'Ĵ' => 'J',
'Ķ' => 'K', 'Ľ' => 'K', 'Ĺ' => 'K', 'Ļ' => 'K', 'Ŀ' => 'K', 'Ł' => 'L',
'Ñ' => 'N', 'Ń' => 'N', 'Ň' => 'N', 'Ņ' => 'N', 'Ŋ' => 'N', 'Ò' => 'O',
'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ø' => 'O', 'Ō' => 'O', 'Ő' => 'O',
'Ŏ' => 'O', 'Ŕ' => 'R', 'Ř' => 'R', 'Ŗ' => 'R', 'Ś' => 'S', 'Ş' => 'S',
'Ŝ' => 'S', 'Ș' => 'S', 'Š' => 'S', 'Ť' => 'T', 'Ţ' => 'T', 'Ŧ' => 'T',
'Ț' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ū' => 'U', 'Ů' => 'U',
'Ű' => 'U', 'Ŭ' => 'U', 'Ũ' => 'U', 'Ų' => 'U', 'Ŵ' => 'W', 'Ŷ' => 'Y',
'Ÿ' => 'Y', 'Ý' => 'Y', 'Ź' => 'Z', 'Ż' => 'Z', 'Ž' => 'Z', 'à' => 'a',
'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ā' => 'a', 'ą' => 'a', 'ă' => 'a',
'å' => 'a', 'ç' => 'c', 'ć' => 'c', 'č' => 'c', 'ĉ' => 'c', 'ċ' => 'c',
'ď' => 'd', 'đ' => 'd', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e',
'ē' => 'e', 'ę' => 'e', 'ě' => 'e', 'ĕ' => 'e', 'ė' => 'e', 'ƒ' => 'f',
'ĝ' => 'g', 'ğ' => 'g', 'ġ' => 'g', 'ģ' => 'g', 'ĥ' => 'h', 'ħ' => 'h',
'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ī' => 'i', 'ĩ' => 'i',
'ĭ' => 'i', 'į' => 'i', 'ı' => 'i', 'ĵ' => 'j', 'ķ' => 'k', 'ĸ' => 'k',
'ł' => 'l', 'ľ' => 'l', 'ĺ' => 'l', 'ļ' => 'l', 'ŀ' => 'l', 'ñ' => 'n',
'ń' => 'n', 'ň' => 'n', 'ņ' => 'n', 'ʼn' => 'n', 'ŋ' => 'n', 'ò' => 'o',
'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ø' => 'o', 'ō' => 'o', 'ő' => 'o',
'ŏ' => 'o', 'ŕ' => 'r', 'ř' => 'r', 'ŗ' => 'r', 'ś' => 's', 'š' => 's',
'ť' => 't', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ū' => 'u', 'ů' => 'u',
'ű' => 'u', 'ŭ' => 'u', 'ũ' => 'u', 'ų' => 'u', 'ŵ' => 'w', 'ÿ' => 'y',
'ý' => 'y', 'ŷ' => 'y', 'ż' => 'z', 'ź' => 'z', 'ž' => 'z', 'Α' => 'A',
'Ά' => 'A', 'Ἀ' => 'A', 'Ἁ' => 'A', 'Ἂ' => 'A', 'Ἃ' => 'A', 'Ἄ' => 'A',
'Ἅ' => 'A', 'Ἆ' => 'A', 'Ἇ' => 'A', 'ᾈ' => 'A', 'ᾉ' => 'A', 'ᾊ' => 'A',
'ᾋ' => 'A', 'ᾌ' => 'A', 'ᾍ' => 'A', 'ᾎ' => 'A', 'ᾏ' => 'A', 'Ᾰ' => 'A',
'Ᾱ' => 'A', 'Ὰ' => 'A', 'ᾼ' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D',
'Ε' => 'E', 'Έ' => 'E', 'Ἐ' => 'E', 'Ἑ' => 'E', 'Ἒ' => 'E', 'Ἓ' => 'E',
'Ἔ' => 'E', 'Ἕ' => 'E', 'Ὲ' => 'E', 'Ζ' => 'Z', 'Η' => 'I', 'Ή' => 'I',
'Ἠ' => 'I', 'Ἡ' => 'I', 'Ἢ' => 'I', 'Ἣ' => 'I', 'Ἤ' => 'I', 'Ἥ' => 'I',
'Ἦ' => 'I', 'Ἧ' => 'I', 'ᾘ' => 'I', 'ᾙ' => 'I', 'ᾚ' => 'I', 'ᾛ' => 'I',
'ᾜ' => 'I', 'ᾝ' => 'I', 'ᾞ' => 'I', 'ᾟ' => 'I', 'Ὴ' => 'I', 'ῌ' => 'I',
'Θ' => 'T', 'Ι' => 'I', 'Ί' => 'I', 'Ϊ' => 'I', 'Ἰ' => 'I', 'Ἱ' => 'I',
'Ἲ' => 'I', 'Ἳ' => 'I', 'Ἴ' => 'I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 'a', 'ᾶ' => 'a', 'ᾷ' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd',
'ε' => 'e', 'έ' => 'e', 'ἐ' => 'e', 'ἑ' => 'e', 'ἒ' => 'e', 'ἓ' => 'e',
'ἔ' => 'e', 'ἕ' => 'e', 'ὲ' => 'e', 'ζ' => 'z', 'η' => 'i', 'ή' => 'i',
'ἠ' => 'i', 'ἡ' => 'i', 'ἢ' => 'i', 'ἣ' => 'i', 'ἤ' => 'i', 'ἥ' => 'i',
'ἦ' => 'i', 'ἧ' => 'i', 'ᾐ' => 'i', 'ᾑ' => 'i', 'ᾒ' => 'i', 'ᾓ' => 'i',
'ᾔ' => 'i', 'ᾕ' => 'i', 'ᾖ' => 'i', 'ᾗ' => 'i', 'ὴ' => 'i', 'ῂ' => 'i',
'ῃ' => 'i', 'ῄ' => 'i', 'ῆ' => 'i', 'ῇ' => 'i', 'θ' => 't', 'ι' => 'i',
'ί' => 'i', 'ϊ' => 'i', 'ΐ' => 'i', 'ἰ' => 'i', 'ἱ' => 'i', 'ἲ' => 'i',
'ἳ' => 'i', 'ἴ' => 'i', 'ἵ' => 'i', 'ἶ' => 'i', 'ἷ' => 'i', 'ὶ' => 'i',
'ῐ' => 'i', 'ῑ' => 'i', 'ῒ' => 'i', 'ῖ' => 'i', 'ῗ' => 'i', 'κ' => 'k',
'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => 'k', 'ο' => 'o', 'ό' => 'o',
'ὀ' => 'o', 'ὁ' => 'o', 'ὂ' => 'o', 'ὃ' => 'o', 'ὄ' => 'o', 'ὅ' => 'o',
'ὸ' => 'o', 'π' => 'p', 'ρ' => 'r', 'ῤ' => 'r', 'ῥ' => 'r', 'σ' => 's',
'ς' => 's', 'τ' => 't', 'υ' => 'y', 'ύ' => 'y', 'ϋ' => 'y', 'ΰ' => 'y',
'ὐ' => 'y', 'ὑ' => 'y', 'ὒ' => 'y', 'ὓ' => 'y', 'ὔ' => 'y', 'ὕ' => 'y',
'ὖ' => 'y', 'ὗ' => 'y', 'ὺ' => 'y', 'ῠ' => 'y', 'ῡ' => 'y', 'ῢ' => 'y',
'ῦ' => 'y', 'ῧ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'p', 'ω' => 'o',
'ώ' => 'o', 'ὠ' => 'o', 'ὡ' => 'o', 'ὢ' => 'o', 'ὣ' => 'o', 'ὤ' => 'o',
'ὥ' => 'o', 'ὦ' => 'o', 'ὧ' => 'o', 'ᾠ' => 'o', 'ᾡ' => 'o', 'ᾢ' => 'o',
'ᾣ' => 'o', 'ᾤ' => 'o', 'ᾥ' => 'o', 'ᾦ' => 'o', 'ᾧ' => 'o', 'ὼ' => 'o',
'ῲ' => 'o', 'ῳ' => 'o', 'ῴ' => 'o', 'ῶ' => 'o', 'ῷ' => 'o', 'А' => 'A',
'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E',
'Ж' => 'Z', 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L',
'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S',
'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'K', 'Ц' => 'T', 'Ч' => 'C',
'Ш' => 'S', 'Щ' => 'S', 'Ы' => 'Y', 'Э' => 'E', 'Ю' => 'Y', 'Я' => 'Y',
'а' => 'A', 'б' => 'B', 'в' => 'V', 'г' => 'G', 'д' => 'D', 'е' => 'E',
'ё' => 'E', 'ж' => 'Z', 'з' => 'Z', 'и' => 'I', 'й' => 'I', 'к' => 'K',
'л' => 'L', 'м' => 'M', 'н' => 'N', 'о' => 'O', 'п' => 'P', 'р' => 'R',
'с' => 'S', 'т' => 'T', 'у' => 'U', 'ф' => 'F', 'х' => 'K', 'ц' => 'T',
'ч' => 'C', 'ш' => 'S', 'щ' => 'S', 'ы' => 'Y', 'э' => 'E', 'ю' => 'Y',
'я' => 'Y', 'ð' => 'd', 'Ð' => 'D', 'þ' => 't', 'Þ' => 'T', 'ა' => 'a',
'ბ' => 'b', 'გ' => 'g', 'დ' => 'd', 'ე' => 'e', 'ვ' => 'v', 'ზ' => 'z',
'თ' => 't', 'ი' => 'i', 'კ' => 'k', 'ლ' => 'l', 'მ' => 'm', 'ნ' => 'n',
'ო' => 'o', 'პ' => 'p', 'ჟ' => 'z', 'რ' => 'r', 'ს' => 's', 'ტ' => 't',
'უ' => 'u', 'ფ' => 'p', 'ქ' => 'k', 'ღ' => 'g', '' => 'q', 'შ' => 's',
'ჩ' => 'c', 'ც' => 't', 'ძ' => 'd', 'წ' => 't', 'ჭ' => 'c', 'ხ' => 'k',
'ჯ' => 'j', 'ჰ' => 'h', 'ţ' => 't', 'ʼ' => "'", '̧' => '', 'ḩ' => 'h',
'' => "'", '' => "'", 'ừ' => 'u', '/' => '', 'ế' => 'e', 'ả' => 'a',
'ị' => 'i', 'ậ' => 'a', 'ệ' => 'e', 'ỉ' => 'i', 'ồ' => 'o', 'ề' => 'e',
'ơ' => 'o', 'ạ' => 'a', 'ẵ' => 'a', 'ư' => 'u', 'ằ' => 'a', 'ầ' => 'a',
'ḑ' => 'd', 'Ḩ' => 'H', 'Ḑ' => 'D', 'ș' => 's', 'ț' => 't', 'ộ' => 'o',
'ắ' => 'a', 'ş' => 's', "'" => '', 'ու' => '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',
);
$arrayFrom = array_keys($transliterationTable);
$arrayTo = array_values($transliterationTable);

View File

@ -64,8 +64,8 @@ class Lorem extends Base
public static function words($nb = 3, $asText = false)
{
$words = array();
for ($i=0; $i < $nb; $i++) {
$words []= static::word();
for ($i = 0; $i < $nb; $i++) {
$words [] = static::word();
}
return $asText ? implode(' ', $words) : $words;
@ -106,8 +106,8 @@ class Lorem extends Base
public static function sentences($nb = 3, $asText = false)
{
$sentences = array();
for ($i=0; $i < $nb; $i++) {
$sentences []= static::sentence();
for ($i = 0; $i < $nb; $i++) {
$sentences [] = static::sentence();
}
return $asText ? implode(' ', $sentences) : $sentences;
@ -145,8 +145,8 @@ class Lorem extends Base
public static function paragraphs($nb = 3, $asText = false)
{
$paragraphs = array();
for ($i=0; $i < $nb; $i++) {
$paragraphs []= static::paragraph();
for ($i = 0; $i < $nb; $i++) {
$paragraphs [] = static::paragraph();
}
return $asText ? implode("\n\n", $paragraphs) : $paragraphs;

View File

@ -136,6 +136,6 @@ abstract class Text extends Base
protected static function appendEnd($text)
{
return preg_replace("/([ ,-:;\x{2013}\x{2014}]+$)/us", '', $text).'.';
return preg_replace("/([ ,-:;\x{2013}\x{2014}]+$)/us", '', $text) . '.';
}
}

View File

@ -1,4 +1,6 @@
<?php namespace Faker\Provider\el_GR;
<?php
namespace Faker\Provider\el_GR;
class Company extends \Faker\Provider\Company
{

View File

@ -1,6 +1,5 @@
<?php
namespace Faker\Provider\en_US;
class Payment extends \Faker\Provider\Payment

View File

@ -57,7 +57,7 @@ class Text extends \Faker\Provider\Text
// build result
$result = implode(' ', $result);
return $result.'.';
return $result . '.';
}
/**

View File

@ -102,7 +102,7 @@ class Person extends \Faker\Provider\Person
}
$datePart = $birthdate->format('dmy');
switch ((int)($birthdate->format('Y')/100)) {
switch ((int)($birthdate->format('Y') / 100)) {
case 18:
$centurySign = '+';
break;

View File

@ -121,7 +121,7 @@ class Person extends \Faker\Provider\Person
// Format is x xx xx xx xxx xxx xx
if ($formatted) {
$nir = substr($nir, 0, 1) . ' ' . substr($nir, 1, 2) . ' ' . substr($nir, 3, 2) . ' ' . substr($nir, 5, 2) . ' ' . substr($nir, 7, 3). ' ' . substr($nir, 10, 3). ' ' . substr($nir, 13, 2);
$nir = substr($nir, 0, 1) . ' ' . substr($nir, 1, 2) . ' ' . substr($nir, 3, 2) . ' ' . substr($nir, 5, 2) . ' ' . substr($nir, 7, 3) . ' ' . substr($nir, 10, 3) . ' ' . substr($nir, 13, 2);
}
return $nir;

View File

@ -78,7 +78,7 @@ class Person extends \Faker\Provider\Person
*/
public function lastNameMale()
{
return $this->lastName().'son';
return $this->lastName() . 'son';
}
/**
@ -88,7 +88,7 @@ class Person extends \Faker\Provider\Person
*/
public function lastNameFemale()
{
return $this->lastName().'dóttir';
return $this->lastName() . 'dóttir';
}
/**
@ -114,10 +114,10 @@ class Person extends \Faker\Provider\Person
while (! $valid) {
// make two random numbers
$rand = static::randomDigit().static::randomDigit();
$rand = static::randomDigit() . static::randomDigit();
// 8 char string with birth date and two random numbers
$tmp = $birthdate->format('dmy').$rand;
$tmp = $birthdate->format('dmy') . $rand;
// loop through temp string
for ($i = 7, $sum = 0; $i >= 0; $i--) {
@ -129,7 +129,7 @@ class Person extends \Faker\Provider\Person
$chk = ($sum % 11 === 0) ? 0 : (11 - ($sum % 11));
if ($chk < 10) {
$lastFour = $rand.$chk.substr($birthdate->format('Y'), 1, 1);
$lastFour = $rand . $chk . substr($birthdate->format('Y'), 1, 1);
$valid = true;
}

View File

@ -2,7 +2,7 @@
namespace Faker\Provider\kk_KZ;
use \Faker\Provider\DateTime;
use Faker\Provider\DateTime;
class Person extends \Faker\Provider\Person
{

View File

@ -362,8 +362,8 @@ class Person extends \Faker\Provider\Person
}
$sum = 0;
for ($i=1; $i <= 10; $i++) {
$sum += $numbers[$i-1] * $multipliers[$i-1];
for ($i = 1; $i <= 10; $i++) {
$sum += $numbers[$i - 1] * $multipliers[$i - 1];
}
return (int) $sum;

View File

@ -2,7 +2,7 @@
namespace Faker\Provider\ms_MY;
use \Faker\Generator;
use Faker\Generator;
class Address extends \Faker\Provider\Address
{

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider\ms_MY;
use Faker\Provider\DateTime;

View File

@ -312,7 +312,7 @@ class Person extends \Faker\Provider\Person
}
$digits = $datePart.$randomDigits.$genderDigit;
$digits = $datePart . $randomDigits . $genderDigit;
/**
* @todo Calculate modulo 11 of $digits
@ -321,6 +321,6 @@ class Person extends \Faker\Provider\Person
$checksum = (string)static::numerify('##');
return $digits.$checksum;
return $digits . $checksum;
}
}

View File

@ -88,9 +88,9 @@ class Person extends \Faker\Provider\Person
{
$middle = self::numberBetween(1, 997);
if ($gender === static::GENDER_MALE) {
$middle = $middle %2 === 1 ? $middle : $middle+1;
$middle = $middle % 2 === 1 ? $middle : $middle + 1;
} elseif ($gender === static::GENDER_FEMALE) {
$middle = $middle %2 === 0 ? $middle : $middle+1;
$middle = $middle % 2 === 0 ? $middle : $middle + 1;
}
$middle = sprintf('%03d', $middle);
@ -98,9 +98,9 @@ class Person extends \Faker\Provider\Person
$dob = sprintf('%06d', $date->format('ymd'));
$help = $date->format('Y') >= 2000 ? 2 : null;
$check = intval($help.$dob.$middle);
$check = intval($help . $dob . $middle);
$rest = sprintf('%02d', 97 - ($check % 97));
return $dob.$middle.$rest;
return $dob . $middle . $rest;
}
}

View File

@ -151,7 +151,7 @@ class Person extends \Faker\Provider\Person
$fullYear = (int) $birthdate->format('Y');
$year = (int) $birthdate->format('y');
$month = $birthdate->format('m') + (((int) ($fullYear/100) - 14) % 5) * 20;
$month = $birthdate->format('m') + (((int) ($fullYear / 100) - 14) % 5) * 20;
$day = $birthdate->format('d');
$result = array((int) ($year / 10), $year % 10, (int) ($month / 10), $month % 10, (int) ($day / 10), $day % 10);
@ -191,11 +191,11 @@ class Person extends \Faker\Provider\Person
$checksum += $weights[$i] * (ord($low[$i]) - 55);
}
for ($i = 0, $size = count($high); $i < $size; $i++) {
$checksum += $weights[$i+3] * $high[$i];
$checksum += $weights[$i + 3] * $high[$i];
}
$checksum %= 10;
return implode('', $low).$checksum.implode('', $high);
return implode('', $low) . $checksum . implode('', $high);
}
/**

View File

@ -28,6 +28,6 @@ class Company extends \Faker\Provider\Company
$n .= check_digit($n);
$n .= check_digit($n);
return $formatted? vsprintf('%d%d.%d%d%d.%d%d%d/%d%d%d%d-%d%d', str_split($n)) : $n;
return $formatted ? vsprintf('%d%d.%d%d%d.%d%d%d/%d%d%d%d-%d%d', str_split($n)) : $n;
}
}

View File

@ -114,7 +114,7 @@ class Person extends \Faker\Provider\Person
$n .= check_digit($n);
$n .= check_digit($n);
return $formatted? vsprintf('%d%d%d.%d%d%d.%d%d%d-%d%d', str_split($n)) : $n;
return $formatted ? vsprintf('%d%d%d.%d%d%d.%d%d%d-%d%d', str_split($n)) : $n;
}
/**
@ -128,6 +128,6 @@ class Person extends \Faker\Provider\Person
$n = $this->generator->numerify('########');
$n .= check_digit($n);
return $formatted? vsprintf('%d%d.%d%d%d.%d%d%d-%s', str_split($n)) : $n;
return $formatted ? vsprintf('%d%d.%d%d%d.%d%d%d-%s', str_split($n)) : $n;
}
}

View File

@ -88,11 +88,11 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
protected static function anyPhoneNumber($type, $formatted = true)
{
$area = static::areaCode();
$number = ($type == 'cellphone')?
$number = ($type == 'cellphone') ?
static::cellphone($formatted) :
static::landline($formatted);
return $formatted? "($area) $number" : $area.$number;
return $formatted ? "($area) $number" : $area . $number;
}
/**

View File

@ -19,11 +19,11 @@ function check_digit($numbers)
for ($i = 1; $i <= $length; $i++) {
if (!$second_algorithm) {
$multiplier = $i+1;
$multiplier = $i + 1;
} else {
$multiplier = ($i >= 9)? $i-7 : $i+1;
$multiplier = ($i >= 9) ? $i - 7 : $i + 1;
}
$verifier += $numbers[$length-$i] * $multiplier;
$verifier += $numbers[$length - $i] * $multiplier;
}
$verifier = 11 - ($verifier % 11);

View File

@ -60,7 +60,7 @@ class Person extends \Faker\Provider\Person
$firstEightDigits = static::numerify(static::randomElement(static::$firstEightDigitsFormat));
$lastDigit = static::dvCalcMod11($firstEightDigits);
return $firstEightDigits.$lastDigit;
return $firstEightDigits . $lastDigit;
}
/**

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider\ro_MD;
class Address extends \Faker\Provider\Address

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider\ro_MD;
class Person extends \Faker\Provider\Person

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider\ro_RO;
class Address extends \Faker\Provider\Address

View File

@ -1,4 +1,5 @@
<?php
namespace Faker\Provider\ro_RO;
class Person extends \Faker\Provider\Person
@ -139,7 +140,7 @@ class Person extends \Faker\Provider\Person
$checksum = $this->getChecksumDigit($cnp);
return $cnp.$checksum;
return $cnp . $checksum;
}
/**

View File

@ -377,19 +377,19 @@ class Address extends \Faker\Provider\Address
public static function localLatitude()
{
return number_format(mt_rand(22000000, 25000000)/1000000, 6);
return number_format(mt_rand(22000000, 25000000) / 1000000, 6);
}
public static function localLongitude()
{
return number_format(mt_rand(120000000, 122000000)/1000000, 6);
return number_format(mt_rand(120000000, 122000000) / 1000000, 6);
}
public function city()
{
$county = static::randomElement(array_keys(static::$city));
$city = static::randomElement(static::$city[$county]);
return $county.$city;
return $county . $city;
}
public function state()
@ -414,6 +414,6 @@ class Address extends \Faker\Provider\Address
public static function secondaryAddress()
{
return (static::randomNumber(2)+1).static::randomElement(static::$secondaryAddressSuffix);
return (static::randomNumber(2) + 1) . static::randomElement(static::$secondaryAddressSuffix);
}
}

View File

@ -51,7 +51,7 @@ class UniqueGenerator
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
}
} while (array_key_exists(serialize($res), $this->uniques[$name]));
$this->uniques[$name][serialize($res)]= null;
$this->uniques[$name][serialize($res)] = null;
return $res;
}