Skip to content

Commit

Permalink
ci: ignore handled deprecation notice from phpstan
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blizzz authored and Grotax committed Jan 8, 2025
1 parent 410be65 commit 31cb113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
bootstrapFiles:
- %currentWorkingDirectory%/../../lib/base.php
excludePaths:
Expand Down

0 comments on commit 31cb113

Please sign in to comment.