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 <henriquemoody@gmail.com>
This commit is contained in:
Henrique Moody 2021-02-06 12:51:56 +01:00
parent 5ba7646925
commit 44a60f67d9
No known key found for this signature in database
GPG Key ID: 221E9281655813A6
2 changed files with 9 additions and 5 deletions

View File

@ -181,7 +181,7 @@ final class Ip extends AbstractRule
throw new ComponentException('Invalid network mask');
}
$this->mask = sprintf('%032b', ip2long(long2ip(~(2 ** (32 - (int) $parts[1]) - 1))));
$this->mask = sprintf('%032b', ip2long((string) long2ip(~(2 ** (32 - (int) $parts[1]) - 1))));
}
private function verifyAddress(string $address): bool

View File

@ -10,14 +10,18 @@ parameters:
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
ignoreErrors:
-
message: '/Ternary operator condition is always false\./'
path: library/Helpers/CanValidateDateTime.php
-
message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./'
path: library/Rules/ArrayVal.php
-
message: '/Parameter #1 \$error_handler of function set_error_handler expects \(callable\(int, string, string, int, array\): bool\)\|null, Closure\(\): void given\./'
paths:
- library/Rules/Call.php
- tests/unit/Rules/CallTest.php
message: '/Return type \(SplObjectStorage\) of method Respect\\Validation\\Exceptions\\NestedValidationException::getIterator\(\)/'
path: library/Exceptions/NestedValidationException.php
-
message: '/Call to an undefined static method Respect\\Validation\\Validator::iDoNotExistSoIShouldThrowException/'
path: tests/unit/ValidatorTest.php