PHP code example of fullsmack / php-cs-fixer-breathe

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

    

fullsmack / php-cs-fixer-breathe example snippets




er = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->exclude('var')
    ->exclude('vendor')
    ->exclude('node_modules');

$config = \FullSmack\PhpCsFixerBreathe\Config::create();

return $config->setFinder($finder);



ullSmack\PhpCsFixerBreathe\Fixer;
use FullSmack\PhpCsFixerBreathe\RuleSet;

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->exclude('var')
    ->exclude('vendor');

$config = new PhpCsFixer\Config();

return $config
    ->registerCustomFixers([
        new Fixer\MatchBraceSameLine(),
        new Fixer\TryBraceSameLine(),
        new Fixer\CatchOnNewLine(),
        new Fixer\ElseOnNewLine(),
        new Fixer\EmptyCatchBodySameLine(),
        new Fixer\MethodReturnTypeBraceRegex(),
    ])
    ->registerCustomRuleSets([
        new RuleSet\Breathe(),
    ])
    ->setRules([
        '@fullsmack/breathe' => true,
        // Override or add additional rules here
    ])
    ->setFinder($finder);



$config = \FullSmack\PhpCsFixerBreathe\Config::create();

return $config
    ->setRules([
        '@fullsmack/breathe' => true,
        'no_unused_imports' => true, // Override default
        'ordered_imports' => [
            'imports_order' => ['class', 'function', 'const'],
        ],
    ])
    ->setFinder($finder);
bash
# Dry run (show what would be fixed)
vendor/bin/php-cs-fixer fix --dry-run --diff

# Fix files
vendor/bin/php-cs-fixer fix

# Fix specific directory
vendor/bin/php-cs-fixer fix src/