diff --git a/src/Faker/ORM/Spot/EntityPopulator.php b/src/Faker/ORM/Spot/EntityPopulator.php index ba5bddb5a4..0ebd675295 100644 --- a/src/Faker/ORM/Spot/EntityPopulator.php +++ b/src/Faker/ORM/Spot/EntityPopulator.php @@ -162,9 +162,8 @@ public function guessColumnFormatters(Generator $generator) if (empty($records)) { return null; } - $id = $records[mt_rand(0, count($records) - 1)]['id']; - return $id; + return $records[mt_rand(0, count($records) - 1)]['id']; } return null; diff --git a/src/Faker/Provider/HtmlLorem.php b/src/Faker/Provider/HtmlLorem.php index b4b2ec1612..9be71bace9 100644 --- a/src/Faker/Provider/HtmlLorem.php +++ b/src/Faker/Provider/HtmlLorem.php @@ -83,7 +83,7 @@ private function addRandomSubTree(\DOMElement $root, $maxDepth, $maxWidth) $this->addRandomAttribute($sibling); $this->addRandomSubTree($sibling, mt_rand(0, $maxDepth), $maxWidth); } - }; + } return $root; } diff --git a/src/Faker/Provider/at_AT/Payment.php b/src/Faker/Provider/at_AT/Payment.php index 11792b4eee..caf8133bb0 100644 --- a/src/Faker/Provider/at_AT/Payment.php +++ b/src/Faker/Provider/at_AT/Payment.php @@ -24,7 +24,7 @@ class Payment extends \Faker\Provider\Payment */ public static function vat($spacedNationalPrefix = true) { - $prefix = ($spacedNationalPrefix) ? "AT U" : "ATU"; + $prefix = $spacedNationalPrefix ? "AT U" : "ATU"; return sprintf("%s%d", $prefix, self::randomNumber(8, true)); } diff --git a/src/Faker/Provider/bg_BG/Payment.php b/src/Faker/Provider/bg_BG/Payment.php index a65870b435..b93816938b 100644 --- a/src/Faker/Provider/bg_BG/Payment.php +++ b/src/Faker/Provider/bg_BG/Payment.php @@ -31,7 +31,7 @@ public static function bankAccountNumber($prefix = '', $countryCode = 'BG', $len */ public static function vat($spacedNationalPrefix = true) { - $prefix = ($spacedNationalPrefix) ? "BG " : "BG"; + $prefix = $spacedNationalPrefix ? "BG " : "BG"; return sprintf( "%s%d%d", diff --git a/src/Faker/Provider/fr_BE/Payment.php b/src/Faker/Provider/fr_BE/Payment.php index da248dacd4..21da5b5c06 100644 --- a/src/Faker/Provider/fr_BE/Payment.php +++ b/src/Faker/Provider/fr_BE/Payment.php @@ -32,7 +32,7 @@ public static function bankAccountNumber($prefix = '', $countryCode = 'BE', $len */ public static function vat($spacedNationalPrefix = true) { - $prefix = ($spacedNationalPrefix) ? "BE " : "BE"; + $prefix = $spacedNationalPrefix ? "BE " : "BE"; return sprintf("%s0%d", $prefix, self::randomNumber(9, true)); } diff --git a/src/Faker/Provider/lt_LT/Person.php b/src/Faker/Provider/lt_LT/Person.php index 47b862bc16..bd7b727f1f 100644 --- a/src/Faker/Provider/lt_LT/Person.php +++ b/src/Faker/Provider/lt_LT/Person.php @@ -302,11 +302,11 @@ public function personalIdentityNumber($gender = 'male', \DateTime $birthdate = $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); } - $genderNumber = ($gender == 'male') ? (int) 1 : (int) 0; + $genderNumber = ($gender == 'male') ? 1 : 0; $firstNumber = (int) floor($birthdate->format('Y') / 100) * 2 - 34 - $genderNumber; $datePart = $birthdate->format('ymd'); - $randomDigits = (string) ( ! $randomNumber || strlen($randomNumber < 3)) ? static::numerify('###') : substr($randomNumber, 0, 3); + $randomDigits = (string) ( ! $randomNumber || strlen($randomNumber) < 3) ? static::numerify('###') : substr($randomNumber, 0, 3); $partOfPerosnalCode = $firstNumber . $datePart . $randomDigits; $sum = self::calculateSum($partOfPerosnalCode, 1); @@ -318,7 +318,7 @@ public function personalIdentityNumber($gender = 'male', \DateTime $birthdate = } $sum = self::calculateSum($partOfPerosnalCode, 2); - $liekana = (int) $sum % 11; + $liekana = $sum % 11; $lastNumber = ($liekana !== 10) ? $liekana : 0; return $firstNumber . $datePart . $randomDigits . $lastNumber; diff --git a/src/Faker/Provider/ms_MY/Person.php b/src/Faker/Provider/ms_MY/Person.php index 7dfaaac578..b38ffa70b2 100644 --- a/src/Faker/Provider/ms_MY/Person.php +++ b/src/Faker/Provider/ms_MY/Person.php @@ -786,8 +786,8 @@ public static function myKadNumber($gender = null, $hyphen = false) $dd = DateTime::dayOfMonth(); // place of birth (1-59 except 17-20) - while (in_array(($pb = mt_rand(1, 59)), array(17, 18, 19, 20))) { - }; + while (in_array($pb = mt_rand(1, 59), array(17, 18, 19, 20))) { + } // random number $nnn = mt_rand(0, 999); diff --git a/src/Faker/Provider/nl_BE/Payment.php b/src/Faker/Provider/nl_BE/Payment.php index 9e1a3b90c1..f8eb23389d 100644 --- a/src/Faker/Provider/nl_BE/Payment.php +++ b/src/Faker/Provider/nl_BE/Payment.php @@ -32,7 +32,7 @@ public static function bankAccountNumber($prefix = '', $countryCode = 'BE', $len */ public static function vat($spacedNationalPrefix = true) { - $prefix = ($spacedNationalPrefix) ? "BE " : "BE"; + $prefix = $spacedNationalPrefix ? "BE " : "BE"; return sprintf("%s0%d", $prefix, self::randomNumber(9, true)); } diff --git a/src/Faker/Provider/ro_RO/PhoneNumber.php b/src/Faker/Provider/ro_RO/PhoneNumber.php index e8af8101ce..377e224559 100644 --- a/src/Faker/Provider/ro_RO/PhoneNumber.php +++ b/src/Faker/Provider/ro_RO/PhoneNumber.php @@ -46,9 +46,8 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber public function phoneNumber() { $type = static::randomElement(array_keys(static::$normalFormats)); - $number = static::numerify(static::randomElement(static::$normalFormats[$type])); - return $number; + return static::numerify(static::randomElement(static::$normalFormats[$type])); } public static function tollFreePhoneNumber() diff --git a/test/Faker/Provider/ColorTest.php b/test/Faker/Provider/ColorTest.php index ff5edac240..29fe2eb1d0 100644 --- a/test/Faker/Provider/ColorTest.php +++ b/test/Faker/Provider/ColorTest.php @@ -20,7 +20,7 @@ public function testSafeHexColor() public function testRgbColorAsArray() { - $this->assertEquals(3, count(Color::rgbColorAsArray())); + $this->assertCount(3, Color::rgbColorAsArray()); } public function testRgbColor() diff --git a/test/Faker/Provider/el_GR/TextTest.php b/test/Faker/Provider/el_GR/TextTest.php index 3f03dd3ad0..68e787160e 100644 --- a/test/Faker/Provider/el_GR/TextTest.php +++ b/test/Faker/Provider/el_GR/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/en_UG/AddressTest.php b/test/Faker/Provider/en_UG/AddressTest.php index 571d93fb21..cadef2373f 100644 --- a/test/Faker/Provider/en_UG/AddressTest.php +++ b/test/Faker/Provider/en_UG/AddressTest.php @@ -21,9 +21,6 @@ public function setUp() $this->faker = $faker; } - /** - * @test - */ public function testCityName() { $city = $this->faker->cityName(); @@ -31,9 +28,6 @@ public function testCityName() $this->assertInternalType('string', $city); } - /** - * @test - */ public function testDistrict() { $district = $this->faker->district(); @@ -41,9 +35,6 @@ public function testDistrict() $this->assertInternalType('string', $district); } - /** - * @test - */ public function testRegion() { $region = $this->faker->region(); diff --git a/test/Faker/Provider/en_US/PhoneNumberTest.php b/test/Faker/Provider/en_US/PhoneNumberTest.php index a54ff88262..be0cc211da 100644 --- a/test/Faker/Provider/en_US/PhoneNumberTest.php +++ b/test/Faker/Provider/en_US/PhoneNumberTest.php @@ -35,7 +35,7 @@ public function testPhoneNumber() } // 10 digits - $this->assertEquals(10, count($digits)); + $this->assertCount(10, $digits); // Last two digits of area code cannot be identical $this->assertNotEquals($digits[1], $digits[2]); @@ -68,7 +68,7 @@ public function testTollFreePhoneNumber() } // 10 digits - $this->assertEquals(10, count($digits)); + $this->assertCount(10, $digits); $areaCode = $digits[0] . $digits[1] . $digits[2]; $this->assertContains($areaCode, array('800', '822', '833', '844', '855', '866', '877', '888', '880', '887', '889')); diff --git a/test/Faker/Provider/fr_FR/AddressTest.php b/test/Faker/Provider/fr_FR/AddressTest.php index 50b40f4b32..25aa0055f6 100644 --- a/test/Faker/Provider/fr_FR/AddressTest.php +++ b/test/Faker/Provider/fr_FR/AddressTest.php @@ -21,9 +21,6 @@ public function setUp() $this->faker = $faker; } - /** - * @test - */ public function testSecondaryAddress() { $secondaryAdress = $this->faker->secondaryAddress(); diff --git a/test/Faker/Provider/fr_FR/TextTest.php b/test/Faker/Provider/fr_FR/TextTest.php index c9c7a4ff0b..792de022e4 100644 --- a/test/Faker/Provider/fr_FR/TextTest.php +++ b/test/Faker/Provider/fr_FR/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/ka_GE/TextTest.php b/test/Faker/Provider/ka_GE/TextTest.php index 0201ceee20..2d645a76fc 100644 --- a/test/Faker/Provider/ka_GE/TextTest.php +++ b/test/Faker/Provider/ka_GE/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/kk_KZ/TextTest.php b/test/Faker/Provider/kk_KZ/TextTest.php index 2c78050645..5d1a18675b 100644 --- a/test/Faker/Provider/kk_KZ/TextTest.php +++ b/test/Faker/Provider/kk_KZ/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/ko_KR/TextTest.php b/test/Faker/Provider/ko_KR/TextTest.php index 336acc8a1c..6f07b6403a 100644 --- a/test/Faker/Provider/ko_KR/TextTest.php +++ b/test/Faker/Provider/ko_KR/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/ro_RO/PersonTest.php b/test/Faker/Provider/ro_RO/PersonTest.php index f4743de621..fbca0350c9 100644 --- a/test/Faker/Provider/ro_RO/PersonTest.php +++ b/test/Faker/Provider/ro_RO/PersonTest.php @@ -239,7 +239,7 @@ protected function isValidCnp($cnp) foreach (range(0, 11) as $digit) { $checksum += (int)substr($cnp, $digit, 1) * (int)substr($checkNumber, $digit, 1); } - $checksum = $checksum % 11; + $checksum %= 11; $checksum = $checksum == 10 ? 1 : $checksum; if ($checksum == substr($cnp, -1)) { diff --git a/test/Faker/Provider/ru_RU/TextTest.php b/test/Faker/Provider/ru_RU/TextTest.php index bbb0eae645..7a962120dc 100644 --- a/test/Faker/Provider/ru_RU/TextTest.php +++ b/test/Faker/Provider/ru_RU/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame( diff --git a/test/Faker/Provider/zh_TW/PersonTest.php b/test/Faker/Provider/zh_TW/PersonTest.php index 167d0fa0e2..538cd7a612 100644 --- a/test/Faker/Provider/zh_TW/PersonTest.php +++ b/test/Faker/Provider/zh_TW/PersonTest.php @@ -40,6 +40,6 @@ public function testPersonalIdentityNumber() } // Validate - $this->assertEquals(0, ($total % 10)); + $this->assertEquals(0, $total % 10); } } diff --git a/test/Faker/Provider/zh_TW/TextTest.php b/test/Faker/Provider/zh_TW/TextTest.php index ab56f83c79..b4424e80e7 100644 --- a/test/Faker/Provider/zh_TW/TextTest.php +++ b/test/Faker/Provider/zh_TW/TextTest.php @@ -21,7 +21,6 @@ protected function getMethod($name) { return $method; } - /** @test */ function testItShouldExplodeTheStringToArray() { $this->assertSame( @@ -35,7 +34,6 @@ function testItShouldExplodeTheStringToArray() ); } - /** @test */ function testItShouldReturnTheStringLength() { $this->assertContains( @@ -44,7 +42,6 @@ function testItShouldReturnTheStringLength() ); } - /** @test */ function testItShouldReturnTheCharacterIsValidStartOrNot() { $this->assertTrue($this->getMethod('validStart')->invokeArgs(null, array('中'))); @@ -58,7 +55,6 @@ function testItShouldReturnTheCharacterIsValidStartOrNot() $this->assertFalse($this->getMethod('validStart')->invokeArgs(null, array('!'))); } - /** @test */ function testItShouldAppendEndPunctToTheEndOfString() { $this->assertSame(