PHP code example of efureev / php-cs-fixer

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

    

efureev / php-cs-fixer example snippets




/**
 * CS Fixer Rules.
 *
 * @see https://github.com/FriendsOfPHP/PHP-CS-Fixer
 * @see https://mlocati.github.io/php-cs-fixer-configurator/
 */
return [
    '@PSR2'                  => true,
    '@PHP71Migration'        => true,
    'binary_operator_spaces' => [
        'operators' => [
            '='  => 'align_single_space',
            '=>' => 'align_single_space',
        ],
    ],
    'blank_line_after_namespace'         => true,
    'blank_line_after_opening_tag'       => true,
];



/**
 * Excludes directories names.
 *
 * NOTE: excludes will works only for directories.
 */
return [
    'bootstrap',
    'storage',
    'vendor',
    'public',
    'resources',
];
shell
$ composer 
shell
$ PHP_CS_FIX_CACHE_FILE_PATH=./.new.cache ./cs-fix