From 9ea4ef7edbeba78b266b47786cc33447a4557128 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 19 Jan 2020 20:08:08 +0100 Subject: [PATCH] PHPStan: document run parameters in project ruleset This makes it easier to run the PHPStan command for the project. Includes: * Using `%currentWorkingDirectory%` instead of `%rootdir%` * Renaming the file to `phpstan.neon.dist` to allow overloading of the config by individual developers. --- composer.json | 2 +- phpstan.neon | 7 ------- phpstan.neon.dist | 10 ++++++++++ 3 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 phpstan.neon create mode 100644 phpstan.neon.dist diff --git a/composer.json b/composer.json index 7e9e3ca9..2e750494 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "scripts": { "test": "./vendor/bin/phpunit", "lint": "./vendor/bin/phpcs", - "phpstan": "./vendor/bin/phpstan analyse -l 7 VariableAnalysis" + "phpstan": "./vendor/bin/phpstan analyse" }, "require" : { "php" : ">=5.6.0", diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index 4d14b17d..00000000 --- a/phpstan.neon +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - autoload_files: - - %rootDir%/../../../vendor/squizlabs/php_codesniffer/autoload.php - excludes_analyse: - - */Tests/* - ignoreErrors: - - '~^Constant T_\w+ not found.$~' diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000..4dcd099b --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,10 @@ +parameters: + level: 7 + autoload_files: + - %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/autoload.php + paths: + - %currentWorkingDirectory%/VariableAnalysis/ + excludes_analyse: + - %currentWorkingDirectory%/VariableAnalysis/Tests/ + ignoreErrors: + - '~^Constant T_\w+ not found.$~'