Skip to content

Commit

Permalink
Removed redundant condition
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Jun 30, 2023
1 parent bde3950 commit af3907e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Services/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ public function parse(string $number): array

if (($length - $i) % 2) {
$digit *= 2;

$checksum += ($digit <= 9 ? $digit : $digit - 9);
}
else {
$checksum += $digit;
}

$checksum += ($digit <= 9 ? $digit : $digit - 9);
}

return [$checksum, $checksum - $number[$length]];
return [$checksum, $checksum - (int) $number[$length]];
}
}

0 comments on commit af3907e

Please sign in to comment.