PHP code example of capsulescodes / php-cs-fixer-custom-fixers
1. Go to this page and download the library: Download capsulescodes/php-cs-fixer-custom-fixers 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/ */
capsulescodes / php-cs-fixer-custom-fixers example snippets
use PhpCsFixer\Config;
return ( new PhpCsFixer\Config() )
...
->registerCustomFixers( [
...
new \CapsulesCodes\PhpCsFixerCustomFixers\Fixers()
...
or
...
new \CapsulesCodes\PhpCsFixerCustomFixers\MethodChainingIndentationFixer(),
new \CapsulesCodes\PhpCsFixerCustomFixers\MultipleLinesAfterImportsFixer(),
new \CapsulesCodes\PhpCsFixerCustomFixers\SpacesInsideSquareBracesFixer()
...
] )
->setRules( [
...
"CapsulesCodes/method_chaining_indentation" : { "multi-line" : 4 },
"CapsulesCodes/multiple_lines_after_imports" : { "lines" : 2 },
"CapsulesCodes/spaces_inside_square_braces" : { "space" : "single" }
...
] )
;