From d7511022f9b4a224f2f4369001e3d39dd0f770e6 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Fri, 17 May 2024 18:44:17 +0200 Subject: [PATCH] Update readme --- README.md | 52 ++++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 7def5c1..f7fa1b0 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,15 @@ Related packages: ## Installation -``` +```bash composer require --dev prestashop/php-dev-tools + +## Development dependencies runtimes +composer require --dev friendsofphp/php-cs-fixer +composer require --dev phpstan/phpstan +composer require --dev prestashop/header-stamp +composer require --dev prestashop/autoindex +composer require --dev squizlabs/php_codesniffer ``` When this project is successfully added to your dependencies, you can enable each review tool on your projet. @@ -35,38 +42,24 @@ When this project is successfully added to your dependencies, you can enable eac [lib-3-repo]: https://github.com/PrestaShop/php-dev-tools/tree/3.x [lib-4-repo]: https://github.com/PrestaShop/php-dev-tools/tree/master -### PHP Cs fixer -```bash -$ php vendor/bin/prestashop-coding-standards cs-fixer:init [--dest /path/to/my/project] -``` - -It'll create a configuration file `.php-cs-fixer.dist.php` in the root of your project. -**Upgrade note :** When upgrading from 4.1.0 to newer version, you should re-run the init script or rename your ``.php_cs.dist`` file to ``.php-cs-fixer.dist.php`` in order to match the new requirements of cs-fixer. - -### Phpstan +## Usage -```bash -$ php vendor/bin/prestashop-coding-standards phpstan:init [--dest /path/to/my/project] -``` +The configuration files added in your project can be freely modified in order to match your needs. -It'll create a default file `phpstan.neon` in `tests/phpstan`, that are required to run phpstan. -The default phpstan level is the lowest available, but we recommend you to update this value to get more recommandations. +Running the tools can be done by calling their respective binary: -PHPStan is not provided by our dependencies, because of the PHP compatibility from projects using this repository. We recommend you to install it globally on your environment: +### PHP CS Fixer -``` -composer global require phpstan/phpstan:^0.12 +Initialize the configuration with: +```bash +$ php vendor/bin/prestashop-coding-standards cs-fixer:init [--dest /path/to/my/project] ``` -## Usage - -The configuration files added in your project can be freely modified in order to match your needs. - -Running the tools can be done by calling its binary: +It'll create a configuration file `.php-cs-fixer.dist.php` in the root of your project. -### PHP CS Fixer +**Upgrade note :** When upgrading from 4.1.0 to newer version, you should re-run the init script or rename your ``.php_cs.dist`` file to ``.php-cs-fixer.dist.php`` in order to match the new requirements of cs-fixer. ```bash $ vendor/bin/php-cs-fixer fix @@ -74,16 +67,15 @@ $ vendor/bin/php-cs-fixer fix ### PHPStan -If you have installed PHPStan globally and made the folder available in your PATH: - -```php -$ _PS_ROOT_DIR_= phpstan --configuration=tests/phpstan/phpstan.neon analyse +```bash +$ php vendor/bin/prestashop-coding-standards phpstan:init [--dest /path/to/my/project] ``` -Otherwise, you can specify the path to the PHPStan binary. For instance: +It'll create a default file `phpstan.neon` in `tests/phpstan`, that are required to run phpstan. +The default phpstan level is the lowest available, but we recommend you to update this value to get more recommandations. ```php -$ _PS_ROOT_DIR_= php ~/.composer/vendor/bin/phpstan.phar --configuration=tests/phpstan/phpstan.neon analyse +$ _PS_ROOT_DIR_= php vendor/bin/phpstan --configuration=tests/phpstan/phpstan.neon analyse ``` ### Autoindex