descom/dev

Package to PHP Developer projects in Descom.es

1.2.0 2024-11-28 08:16 UTC

This package is auto-updated.

Last update: 2024-11-28 08:21:07 UTC


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"
}