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/ */
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);
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/
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.