Skip to content

Commit dd8df33

Browse files
authored
Fix: Return string (#726)
1 parent 1f83b68 commit dd8df33

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ parameters:
1515
count: 1
1616
path: src/Faker/Calculator/Luhn.php
1717

18-
-
19-
message: "#^Method Faker\\\\Calculator\\\\Luhn\\:\\:computeCheckDigit\\(\\) should return string but returns int\\.$#"
20-
count: 1
21-
path: src/Faker/Calculator/Luhn.php
22-
2318
-
2419
message: "#^Result of && is always false\\.$#"
2520
count: 1

psalm.baseline.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
3-
<file src="src/Faker/Calculator/Luhn.php">
4-
<InvalidReturnStatement>
5-
<code>0</code>
6-
</InvalidReturnStatement>
7-
<InvalidReturnType>
8-
<code>string</code>
9-
</InvalidReturnType>
10-
</file>
113
<file src="src/Faker/Generator.php">
124
<InvalidReturnStatement>
135
<code><![CDATA[$this->uniqueGenerator]]></code>

src/Faker/Calculator/Luhn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static function computeCheckDigit($partialNumber)
4444
$checkDigit = self::checksum($partialNumber . '0');
4545

4646
if ($checkDigit === 0) {
47-
return 0;
47+
return '0';
4848
}
4949

5050
return (string) (10 - $checkDigit);

0 commit comments

Comments
 (0)