From f79f641b9f5b8638da01e10904fd9b5f5400f03a Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sun, 5 Jan 2025 21:17:42 +0100 Subject: [PATCH] ci: ignore handled deprecation notice from phpstan The code already uses the new methods if available, the deprecated method is used only on older yet still supported Nextcloud versions. Signed-off-by: Arthur Schiwon --- lib/Controller/PageController.php | 4 +++- phpstan.neon.dist | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index f85df557c9..41e056d00f 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -57,10 +57,12 @@ public function index(): TemplateResponse { $status = $this->statusService->getStatus(); - // TODO: Remove check when dropping NC 30. + // TODO: Remove check when dropping NC 30. Also consider dropping the reportUnmatchedIgnoredErrors line from + // the phpstan config. if (class_exists('\OCP\ServerVersion')) { $version = (new \OCP\ServerVersion())->getMajorVersion(); } else { + /* @phpstan-ignore staticMethod.deprecated */ $version = Util::getVersion()[0]; } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index c466bff2fd..324b8acf23 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,7 @@ parameters: inferPrivatePropertyTypeFromConstructor: true treatPhpDocTypesAsCertain: false + reportUnmatchedIgnoredErrors: false bootstrapFiles: - %currentWorkingDirectory%/../../lib/base.php excludePaths: