PHP code example of xmarcos / php-cs-fixer-config

1. Go to this page and download the library: Download xmarcos/php-cs-fixer-config library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xmarcos / php-cs-fixer-config example snippets




$config = new xmarcos\PhpCsFixer\Config\Php56();

$config
    ->setUsingCache(true)
    ->getFinder()
    ->in(__DIR__);

return $config;

$finder
    ->files()
    ->name('*.php')
    ->name('*.phpt')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true)
    ->exclude('vendor');

$header = <<<'EOF'
(c) 2017 Marcos Sader.

For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;

$config = new xmarcos\PhpCsFixer\Config\Php56($header);

...
json
"scripts": {
    "cs": "php-cs-fixer fix --config=.php_cs.dist -v --diff --dry-run",
    "cs-fix": "php-cs-fixer fix --config=.php_cs.dist -v --diff"
}