From 65fa62e709fb5952fa0fafb4b1045f456fe4b3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 13 Jan 2025 12:03:58 +0000 Subject: [PATCH 1/2] Run PHPStan on DOM extension --- phpstan.neon | 13 +- tests/phpstan/php8.4-dom.php | 2697 ++++++++++++++++++++++++++++++++++ 2 files changed, 2700 insertions(+), 10 deletions(-) create mode 100644 tests/phpstan/php8.4-dom.php diff --git a/phpstan.neon b/phpstan.neon index 12fbe44..1892b87 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,24 +1,17 @@ parameters: level: 8 + bootstrapFiles: + - tests/phpstan/php8.4-dom.php paths: - src - tests excludePaths: analyse: - tests/_Integration/_Server + - tests/phpstan/php8.4-dom.php reportUnmatchedIgnoredErrors: false ignoreErrors: - "#^Call to an undefined method Pest\\\\PendingCalls\\\\TestCall\\|Pest\\\\Support\\\\HigherOrderTapProxy\\:\\:(with|throws)\\(\\).$#" - "#^Access to an undefined property Spatie\\\\Invade\\\\Invader#" - "#^Call to an undefined method Spatie\\\\Invade\\\\Invader#" - "#^Call to protected method [a-zA-Z]{5,30}\\(\\) of class PHPUnit\\\\Framework\\\\TestCase.#" - - "#^(?:Parameter|Method) .+ has invalid (return )?type Dom\\\\.+\\.#" - - "#^Call to .+ on an unknown class Dom\\\\.+\\.#" - - "#^Property .+ has unknown class Dom\\\\.+ as its type\\.#" - - "#^Class Dom\\\\.+ not found.#" - - "#^Access to property .+ on an unknown class Dom\\\\.+\\.#" - - "#^PHPDoc tag .+ contains unknown class Dom\\\\.+\\.#" - - "#^Call to an undefined (static )?method Dom\\\\.+::.+\\(\\)\\.#" - - "#^Access to an undefined property Dom\\\\.+::\\$.+\\.#" - - "#^Function .+ has invalid return type Dom\\\\.+\\.#" - - "#^(?:Used )?(?:C|c)onstant DOM\\\\.+ not found\\.#" diff --git a/tests/phpstan/php8.4-dom.php b/tests/phpstan/php8.4-dom.php new file mode 100644 index 0000000..68e3851 --- /dev/null +++ b/tests/phpstan/php8.4-dom.php @@ -0,0 +1,2697 @@ + Date: Mon, 13 Jan 2025 12:08:46 +0000 Subject: [PATCH 2/2] Make it PHP 8.1 compatible --- tests/phpstan/php8.4-dom.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpstan/php8.4-dom.php b/tests/phpstan/php8.4-dom.php index 68e3851..a743714 100644 --- a/tests/phpstan/php8.4-dom.php +++ b/tests/phpstan/php8.4-dom.php @@ -553,7 +553,7 @@ public function __wakeup() : void namespace Dom; -final readonly class NamespaceInfo +final class NamespaceInfo { /** * @var ?string