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'); 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 private function verifyAddress(string $address): bool

View file

@ -10,14 +10,18 @@ parameters:
checkGenericClassInNonGenericObjectType: false checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false checkMissingIterableValueType: false
ignoreErrors: ignoreErrors:
-
message: '/Ternary operator condition is always false\./'
path: library/Helpers/CanValidateDateTime.php
- -
message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./' message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./'
path: library/Rules/ArrayVal.php 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\./' message: '/Return type \(SplObjectStorage\) of method Respect\\Validation\\Exceptions\\NestedValidationException::getIterator\(\)/'
paths: path: library/Exceptions/NestedValidationException.php
- library/Rules/Call.php
- tests/unit/Rules/CallTest.php
- -
message: '/Call to an undefined static method Respect\\Validation\\Validator::iDoNotExistSoIShouldThrowException/' message: '/Call to an undefined static method Respect\\Validation\\Validator::iDoNotExistSoIShouldThrowException/'
path: tests/unit/ValidatorTest.php path: tests/unit/ValidatorTest.php