Static analysis tools for PHP projects
Provides php-cs-fixer, phpstan, psalm, rector, & twigcs as isolated
composer installs within your project. This eliminates the need to worry about
any underlying conflicts with tool dependencies and your own project dependencies.
All commands are run from your root project directory. e.g. path/to/your-project
-
Run
composer install -d tools -
Run
git submodule add https://github.com/rushlow-development/php-tools tools. This will "clone" thephp-toolsrepo intopath-to-project/tools. -
Run
tools/bin/installwhich will runcomposer upgradein each of the tool directories. -
Copy and paste the contents of
scripts.jsoninto yourrootcomposer.json file. This will allow you to runcomposer tools:runfrom your project root directory.
I'd like to use composer plugins / custom installers to automate this. Allowing one
to run composer require --dev rushlow-development/php-tools and then the tools
would be installed as needed...