diff --git a/.phpstan.neon b/.phpstan.neon index fb731728b8..551cf2b69b 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -2,6 +2,9 @@ # # SPDX-License-Identifier: CC0-1.0 +includes: + - vendor/phpstan/phpstan-strict-rules/rules.neon + parameters: level: 3 @@ -23,6 +26,9 @@ parameters: dynamicConstantNames: - DB_UPDATE_VERSION + strictRules: + allRules: false + ignoreErrors: - # Ignore missing GdImage class in PHP <= 7.4 diff --git a/composer.json b/composer.json index 9973336590..fc26674ca7 100644 --- a/composer.json +++ b/composer.json @@ -157,6 +157,7 @@ "php-mock/php-mock-phpunit": "^2.10", "phpmd/phpmd": "^2.15", "phpstan/phpstan": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^9" }, "scripts": { diff --git a/composer.lock b/composer.lock index fb9fadddbd..ab66a33d05 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "897b878d6db24b9a6437bd9f971478be", + "content-hash": "e93a8ac7e31cf3e5e0ca76134e5ffa0b", "packages": [ { "name": "asika/simple-console", @@ -5849,6 +5849,54 @@ ], "time": "2024-11-11T15:43:04+00:00" }, + { + "name": "phpstan/phpstan-strict-rules", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158", + "reference": "a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Extra strict and opinionated rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.0" + }, + "time": "2024-10-26T16:04:33+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.31",