PHP code example of eduarguz / shift-php-cs

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

    

eduarguz / shift-php-cs example snippets




use PhpCsFixer\Finder;

$project_path = getcwd();
$finder = Finder::create()
    ->in([
        $project_path . '/app',
        $project_path . '/config',
        $project_path . '/database',
        $project_path . '/resources',
        $project_path . '/routes',
        $project_path . '/tests',
    ])
    ->name('*.php')
    ->notName('*.blade.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return \ShiftCS\styles($finder);

sh
touch .php-cs-fixer.php
sh
./vendor/bin/php-cs-fixer fix
sh
./vendor/bin/php-cs-fixer fix --dry-run