Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Deserializer/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="../vendor/autoload.php" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
bootstrap="../vendor/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
failOnDeprecation="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<testsuites>
<testsuite name="Sabre_XML">
<directory>.</directory>
Expand Down