From 042f89b8189870a5c4539d6d1800564fc15a5b31 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 19 Oct 2023 00:09:55 +0200 Subject: [PATCH] Update inspections.md Signed-off-by: Dennis Eichhorn --- quality/inspections.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/quality/inspections.md b/quality/inspections.md index 9fa128b..b98485b 100755 --- a/quality/inspections.md +++ b/quality/inspections.md @@ -7,6 +7,8 @@ Code inspections are very important in order to maintain the same code quality t The following automated tests must pass without errors, failures and warnings for successful code changes: * `php ./vendor/bin/phpstan analyse -l 9 -c Build/Config/phpstan.neon ./` +* `php vendor/bin/php-cs-fixer fix ./ --config=Build/Config/.php-cs-fixer.php --allow-risky=yes` +* `php vendor/bin/phpcbf --standard=Build/Config/phpcs.xml ./` * `php ./vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml"` * `php ./vendor/bin/phpunit -c tests/phpunit_no_coverage.xml` * `php ./vendor/bin/rector process --config Build/Config/rector.php --dry-run ./` @@ -121,11 +123,11 @@ Tools used for the code inspection are: * PHPStan * Jasmine * PHPCS +* PHP CS Fixer +* PHP CBF * Rector * Custom scripts/tools -These tools are all installed by running the `setup.sh` script from the Build repository. - ### PHPUnit This application uses PHPUnit as unit testing framework. Unit tests for specific classes need to be named in the same manner as the testing class. @@ -176,6 +178,22 @@ php vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" -s --re > Many IDEs allow to integrate phpcs rules/configuration files for automatic checks in the editor +### PHP CS Fixer + +The php code base has a defined code style standard. The following command automatically fixes some of the violations + +```sh +php vendor/bin/php-cs-fixer fix ./ --config=Build/Config/.php-cs-fixer.php --allow-risky=yes +``` + +### PHP CBF + +The php code base has a defined code style standard. The following command automatically fixes some of the violations + +```sh +php vendor/bin/phpcbf --standard=Build/Config/phpcs.xml ./ +``` + ### Rector ```sh