PHP code example of jreklund / php-cs-fixer-compat

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

    

jreklund / php-cs-fixer-compat example snippets


$config = new PhpCsFixer\Config();

return $config
    ->registerCustomFixers([
        new PhpCsFixerCompat\Fixer\Basic\BracesFixer380(),
    ])
    ->setRules([
        '@PER' => true,
        'control_structure_braces' => false,
        'control_structure_continuation_position' => false,
        'braces_position' => false,
        'no_multiple_statements_per_line' => false,
        'statement_indentation' => false,
        'PhpCsFixerCompat/braces_380' => true,
    ])
    ->setFinder(
        PhpCsFixer\Finder::create()
        ->exclude('vendor')
        ->in(__DIR__)
    );

$compatPath = implode(DIRECTORY_SEPARATOR, [
    __DIR__,
    'vendor',
    'jreklund',
    'php-cs-fixer-compat',
]);

$bootstrap = $compatPath . DIRECTORY_SEPARATOR . 'bootstrap.php';

if (file_exists($bootstrap)) {