From d40861fbdcaac864999a04ae732ad49e7c51ad47 Mon Sep 17 00:00:00 2001 From: Mihai Zaharie Date: Mon, 6 Jan 2014 11:03:40 +0200 Subject: [PATCH] Make PSR (all) compliant through PHP CS Fixer --- src/Faker/Provider/ro_RO/Person.php | 18 ++++++------------ src/Faker/Provider/ro_RO/PhoneNumber.php | 3 +++ test/Faker/Provider/ro_RO/PersonTest.php | 3 +-- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Faker/Provider/ro_RO/Person.php b/src/Faker/Provider/ro_RO/Person.php index 69b8d30c..27723c23 100644 --- a/src/Faker/Provider/ro_RO/Person.php +++ b/src/Faker/Provider/ro_RO/Person.php @@ -155,12 +155,9 @@ class Person extends \Faker\Provider\Person */ public function cnp($gender = null, $century = null, $county = null) { - if (is_null($county) || !array_key_exists($county, static::$cnpCountyCodes)) - { + if (is_null($county) || !array_key_exists($county, static::$cnpCountyCodes)) { $countyCode = static::randomElement(array_values(static::$cnpCountyCodes)); - } - else - { + } else { $countyCode = static::$cnpCountyCodes[$county]; } @@ -187,8 +184,7 @@ class Person extends \Faker\Provider\Person */ protected static function cnpFirstDigit($gender = null, $century = null) { - switch ($century) - { + switch ($century) { case 1800: case 3: case 4: @@ -208,8 +204,7 @@ class Person extends \Faker\Provider\Person $centuryCode = static::randomElement(array(0, 2, 4, 6, 9)); } - switch (strtolower($gender)) - { + switch (strtolower($gender)) { case 'm': case 1: $genderCode = 1; @@ -231,15 +226,14 @@ class Person extends \Faker\Provider\Person * Calculates a checksum for the Personal Numerical Code (CNP). * * @param string $cnp Randomly generated CNP - * @return string CNP with the last digit altered to a proper checksum + * @return string CNP with the last digit altered to a proper checksum */ protected static function cnpAddChecksum($cnp) { $checkNumber = 279146358279; $checksum = 0; - foreach (range(0, 11) as $digit) - { + foreach (range(0, 11) as $digit) { $checksum += substr($cnp, $digit, 1) * substr($checkNumber, $digit, 1); } $checksum = $checksum % 11; diff --git a/src/Faker/Provider/ro_RO/PhoneNumber.php b/src/Faker/Provider/ro_RO/PhoneNumber.php index 812736db..9e3c07fe 100644 --- a/src/Faker/Provider/ro_RO/PhoneNumber.php +++ b/src/Faker/Provider/ro_RO/PhoneNumber.php @@ -47,18 +47,21 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber { $type = static::randomElement(array_keys(static::$normalFormats)); $number = static::numerify(static::randomElement(static::$normalFormats[$type])); + return $number; } public static function tollFreePhoneNumber() { $number = static::numerify(static::randomElement(static::$specialFormats['toll-free'])); + return $number; } public static function premiumRatePhoneNumber() { $number = static::numerify(static::randomElement(static::$specialFormats['premium-rate'])); + return $number; } } diff --git a/test/Faker/Provider/ro_RO/PersonTest.php b/test/Faker/Provider/ro_RO/PersonTest.php index 6fe89ebe..1c8ecfc6 100644 --- a/test/Faker/Provider/ro_RO/PersonTest.php +++ b/test/Faker/Provider/ro_RO/PersonTest.php @@ -76,8 +76,7 @@ class PersonTest extends \PHPUnit_Framework_TestCase $checkNumber = 279146358279; $checksum = 0; - foreach (range(0, 11) as $digit) - { + foreach (range(0, 11) as $digit) { $checksum += substr($cnp, $digit, 1) * substr($checkNumber, $digit, 1); } $checksum = $checksum % 11;