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

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

    

sirix / php-cs-fixer-config example snippets


    
    
    declare(strict_types=1);
    
    use Sirix\CsFixerConfig\ConfigBuilder;
    
    return ConfigBuilder::create()
        ->inDir(__DIR__ . '/src')
        ->inDir(__DIR__ . '/test')
        ->getConfig()
    ;

        
        
        declare(strict_types=1);
        
        use Sirix\CsFixerConfig\ConfigBuilder;
        
        return ConfigBuilder::create()
            ->inDir(__DIR__ . '/config')
            ->inDir(__DIR__ . '/src')
            ->inDir(__DIR__ . '/test')
            ->setRules([
                'Gordinskiy/line_length_limit' => ['max_length' => 150],
                '@PHP83Migration' => true,
            ])
            ->getConfig()
        ;
bash
composer req --dev --working-dir=tools/php-cs-fixer sirix/php-cs-fixer-config
bash
$ php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -v
bash
$ php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run
bash
$ php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run -v --diff