Via Composer
composer require --dev descom/dev
bash <(curl -Ls https://raw.githubusercontent.com/descom-es/php-dev/master/setup.sh)
Install php-cs-fixer.
composer require --dev friendsofphp/php-cs-fixer
Create file .php-cs-fixer.dist.php
in root project with content:
<?php
$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setRules(Descom\Dev\CsFixer::rules())
->setFinder($finder);
Install extension PHP CS Fixer
With this settings:
{
"php-cs-fixer.onsave": true,
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer"
}