# Configuration file for PHPStan static code checking, see https://phpstan.org . # PHPStan is triggered on Drupal CI in commit-code-check.sh. includes: - phpstan-baseline.neon parameters: level: 0 paths: - . - ../composer excludePaths: # Skip settings. - ../*/settings*.php # Skip test fixtures. - ../*/node_modules/* - */tests/fixtures/*.php - */tests/fixtures/*.php.gz # Skip Drupal 6 & 7 code. - core/scripts/generate-d6-content.sh - core/scripts/generate-d7-content.sh # Skip data files. - lib/Drupal/Component/Transliteration/data/*.php # Below extends on purpose a non existing class for testing. - modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php ignoreErrors: # new static() is a best practice in Drupal, so we cannot fix that. - "#^Unsafe usage of new static#" # Ignore common errors for now. - "#Drupal calls should be avoided in classes, use dependency injection instead#" - "#^Plugin definitions cannot be altered.#" - "#^Missing cache backend declaration for performance.#" - "#cache tag might be unclear and does not contain the cache key in it.#" - "#^Class .* extends @internal class#" # This check was ignored on purpose until the issues with it, which started in version 1.1.15, are solved. # @see https://www.drupal.org/node/3280328 - "#^Missing explicit access check on entity query.#"