PHP Tooling
PHP Stan
https://github.com/phpstan/phpstan
Install PHPStan with Composer
composer require --dev phpstan/phpstan
Analyse
vendor/bin/phpstan analyse {directories to analyse}
Config
Basic phpstan.neon
config
parameters:
level: 7
paths:
- src
- tests
PHP CS Fixer
Install globally with composer
composer global require friendsofphp/php-cs-fixer
Then make sure you have the global Composer binaries directory in your PATH
export PATH="$PATH:$HOME/.composer/vendor/bin"
Config
<?php
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
)
;