descom / dev
Package to PHP Developer projects in Descom.es
1.1.0
2024-04-18 14:55 UTC
Requires
- php: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.35
- phpstan/phpstan: ^1.8
- phpunit/phpunit: ^9.5|^10.0|^10.5
Suggests
- friendsofphp/php-cs-fixer: Required to apply styles
README
Install
Via Composer
composer require --dev descom/dev
Usage
PHP CS Fixer
Using setup.sh
bash <(curl -Ls https://raw.githubusercontent.com/descom-es/php-dev/master/setup.sh)
Manually
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);
Configure PHP CS Fixer in VS Code
Install extension PHP CS Fixer
With this settings:
{ "php-cs-fixer.onsave": true, "php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer" }