diff --git a/lib/Deserializer/functions.php b/lib/Deserializer/functions.php index c0ecb4d..7b8f715 100644 --- a/lib/Deserializer/functions.php +++ b/lib/Deserializer/functions.php @@ -358,7 +358,12 @@ function functionCaller(Reader $reader, callable $func, string $namespace) } elseif (is_string($func) && str_contains($func, '::')) { // We have a string that should refer to a method that exists, like "MyClass::someMethod" // ReflectionMethod knows how to handle that as-is - $ref = new \ReflectionMethod($func); + if (PHP_VERSION_ID >= 80400) { + // @phpstan-ignore staticMethod.notFound + $ref = \ReflectionMethod::createFromMethodName($func); + } else { + $ref = new \ReflectionMethod($func); + } } elseif ($func instanceof \Closure || is_string($func)) { // We have an actual Closure (a real function) or a string that is the name of a function // ReflectionFunction can take either of those diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ec0c143..675fad3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,6 +1,6 @@ parameters: ignoreErrors: - - message: "#^Call to function is_null\\(\\) with null will always evaluate to true\\.$#" + rawMessage: "Call to function is_null() with null will always evaluate to true." path: lib/Serializer/functions.php count: 1 diff --git a/phpstan.neon b/phpstan.neon index a6beaea..14f00f0 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,5 +8,5 @@ parameters: - tests ignoreErrors: - - message: '#^Dynamic call to static method XMLReader::XML\(\)\.$#' + rawMessage: 'Dynamic call to static method XMLReader::XML().' identifier: staticMethod.dynamicCall diff --git a/tests/phpunit.xml b/tests/phpunit.xml index efb74fd..651f97c 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,5 +1,15 @@ - + .