diff --git a/README.md b/README.md index 5a1c6f2..1294953 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WebifyCMS Dev Tools -Set of development tools to analyze and auto fix code standards, formatting and other stuffs for WebifyCMS packages. +Set of development tools to analyze and auto-fix code standards, formatting and other stuff for WebifyCMS packages. The following libraries are included: @@ -46,7 +46,7 @@ includes: - Rector -Add `rector.php` in the root directory and the following, if you need to add more paths you can add them as well: +Add `rector.php` in the root directory and the following, if you need to add more paths, you can add them as well: ```php use Webify\Tools\Rector; @@ -68,6 +68,15 @@ return (new Rector()) vendor/bin/phpstan analyse [options] [...] ``` +Additionally, add the following to your `phpstan.neon` file to enable installed PHPStan extensions: + +```neon +includes: + - vendor/phpstan/phpstan-strict-rules/rules.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-deprecation-rules/rules.neon +``` + - Run code sniffer and format your codes. (Recommended) If you wish to fix manually, you can just output the rules that will apply like the following. @@ -76,7 +85,7 @@ vendor/bin/phpstan analyse [options] [...] ./vendor/bin/php-cs-fixer fix --verbose --diff --show-progress=dots --dry-run ``` -If you wish to auto fix the files, and output the summary of changes you can run the following. +If you wish to auto-fix the files and output the summary of changes, you can run the following. ```bash ./vendor/bin/php-cs-fixer fix --verbose --show-progress=dots diff --git a/phpstan-default.neon b/phpstan-default.neon index d35da2f..5edf401 100644 --- a/phpstan-default.neon +++ b/phpstan-default.neon @@ -6,10 +6,6 @@ # @license https://webifycms.com/extension/tools/license # @author Mohammed Shifreen -includes: - - vendor/phpstan/phpstan-strict-rules/rules.neon - - vendor/phpstan/phpstan-phpunit/extension.neon - - vendor/phpstan/phpstan-deprecation-rules/rules.neon parameters: level: 8 treatPhpDocTypesAsCertain: false diff --git a/phpstan.dist.neon b/phpstan.dist.neon index da32fd6..f91db24 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -7,4 +7,7 @@ # @author Mohammed Shifreen includes: - - phpstan-default.neon \ No newline at end of file + - phpstan-default.neon + - vendor/phpstan/phpstan-strict-rules/rules.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-deprecation-rules/rules.neon \ No newline at end of file