Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit 1bf4438

Browse files
committed
Curly braces for arrays is deprecated in PHP 7.4 (detected by PHPCompatibility)
1 parent 81b3400 commit 1bf4438

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Faker/Calculator/Luhn.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ private static function checksum($number)
2424
$length = strlen($number);
2525
$sum = 0;
2626
for ($i = $length - 1; $i >= 0; $i -= 2) {
27-
$sum += $number{$i};
27+
$sum += $number[$i];
2828
}
2929
for ($i = $length - 2; $i >= 0; $i -= 2) {
30-
$sum += array_sum(str_split($number{$i} * 2));
30+
$sum += array_sum(str_split($number[$i] * 2));
3131
}
3232

3333
return $sum % 10;

test/Faker/Provider/fi_FI/PersonTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ public function testPersonalIdentityNumberGeneratesCompliantNumbers()
7171
public function testPersonalIdentityNumberGeneratesOddValuesForMales()
7272
{
7373
$pin = $this->faker->personalIdentityNumber(null, 'male');
74-
$this->assertEquals(1, $pin{9} % 2);
74+
$this->assertEquals(1, $pin[9] % 2);
7575
}
7676

7777
public function testPersonalIdentityNumberGeneratesEvenValuesForFemales()
7878
{
7979
$pin = $this->faker->personalIdentityNumber(null, 'female');
80-
$this->assertEquals(0, $pin{9} % 2);
80+
$this->assertEquals(0, $pin[9] % 2);
8181
}
8282
}

test/Faker/Provider/sv_SE/PersonTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public function testPersonalIdentityNumberGeneratesLuhnCompliantNumbers()
5050
public function testPersonalIdentityNumberGeneratesOddValuesForMales()
5151
{
5252
$pin = $this->faker->personalIdentityNumber(null, 'male');
53-
$this->assertEquals(1, $pin{9} % 2);
53+
$this->assertEquals(1, $pin[9] % 2);
5454
}
5555

5656
public function testPersonalIdentityNumberGeneratesEvenValuesForFemales()
5757
{
5858
$pin = $this->faker->personalIdentityNumber(null, 'female');
59-
$this->assertEquals(0, $pin{9} % 2);
59+
$this->assertEquals(0, $pin[9] % 2);
6060
}
6161
}

0 commit comments

Comments
 (0)