Skip to content

Commit 44a60f6

Browse files
committed
Fix PHPStan issues
This commit will fix an issue but ignore two of them because it will require some refactoring that won't be possible in a PATCH version. Signed-off-by: Henrique Moody <[email protected]>
1 parent 5ba7646 commit 44a60f6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

library/Rules/Ip.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private function parseRangeUsingCidr(string $input): void
181181
throw new ComponentException('Invalid network mask');
182182
}
183183

184-
$this->mask = sprintf('%032b', ip2long(long2ip(~(2 ** (32 - (int) $parts[1]) - 1))));
184+
$this->mask = sprintf('%032b', ip2long((string) long2ip(~(2 ** (32 - (int) $parts[1]) - 1))));
185185
}
186186

187187
private function verifyAddress(string $address): bool

phpstan.neon.dist

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ parameters:
1010
checkGenericClassInNonGenericObjectType: false
1111
checkMissingIterableValueType: false
1212
ignoreErrors:
13+
-
14+
message: '/Ternary operator condition is always false\./'
15+
path: library/Helpers/CanValidateDateTime.php
16+
1317
-
1418
message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./'
1519
path: library/Rules/ArrayVal.php
20+
1621
-
17-
message: '/Parameter #1 \$error_handler of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, Closure\(\): void given\./'
18-
paths:
19-
- library/Rules/Call.php
20-
- tests/unit/Rules/CallTest.php
22+
message: '/Return type \(SplObjectStorage\) of method Respect\\Validation\\Exceptions\\NestedValidationException::getIterator\(\)/'
23+
path: library/Exceptions/NestedValidationException.php
24+
2125
-
2226
message: '/Call to an undefined static method Respect\\Validation\\Validator::iDoNotExistSoIShouldThrowException/'
2327
path: tests/unit/ValidatorTest.php

0 commit comments

Comments
 (0)