diff --git a/library/Rules/Ip.php b/library/Rules/Ip.php index ccebc76e..ea3d7d4e 100644 --- a/library/Rules/Ip.php +++ b/library/Rules/Ip.php @@ -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 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4c1abe11..7b80a707 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -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