Skip to content

Commit

Permalink
Replace Depreciated Curly Braces with Brackets (#8)
Browse files Browse the repository at this point in the history
Replace Depreciated Curly Braces with Brackets
  • Loading branch information
TheMY3 authored Feb 3, 2020
2 parents 5b765dd + 6a6b3c5 commit 422250e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ protected static function luhnCheck($number)
{
$checksum = 0;
for ($i = (2 - (strlen($number) % 2)); $i <= strlen($number); $i += 2) {
$checksum += (int)($number{$i - 1});
$checksum += (int)($number[$i - 1]);
}

// Analyze odd digits in even length strings or even digits in odd length strings.
for ($i = (strlen($number) % 2) + 1; $i < strlen($number); $i += 2) {
$digit = (int)($number{$i - 1}) * 2;
$digit = (int)($number[$i - 1]) * 2;
if ($digit < 10) {
$checksum += $digit;
} else {
Expand Down

0 comments on commit 422250e

Please sign in to comment.