PHP code example of chieftools / php-cs-fixer

1. Go to this page and download the library: Download chieftools/php-cs-fixer 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/ */

    

chieftools / php-cs-fixer example snippets




$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__ . '/app')
    ->in(__DIR__ . '/tests')
    ->in(__DIR__ . '/config')
    ->in(__DIR__ . '/routes')
    ->in(__DIR__ . '/database')
    ->name('*.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return ChiefTools\PhpCsFixer\Config::make($finder);


return ChiefTools\PhpCsFixer\Config::make($finder, [
    'yoda_style'      => true,
    'ordered_imports' => [
        'sort_algorithm' => 'alpha',
    ],
]);
json
{
    "config": {
        "allow-plugins": {
            "chieftools/php-cs-fixer": true
        }
    }
}
text
vendor/chieftools/php-cs-fixer/.editorconfig
diff
- $data      = [];
- $otherDate = $date
+ $data       = [];
+ $otherDate  = $date
      ->addDays(5);
  $commonDate = now();