Last active
November 8, 2020 19:14
-
-
Save julienbourdeau/4fb8cab4d307e0a689ffa8b314e97b4d to your computer and use it in GitHub Desktop.
Minimalist PHP CS Fixer config for Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->in([ | |
__DIR__.'/app', | |
__DIR__.'/tests', | |
]) | |
; | |
$rulesToDisable = [ | |
'multiline_whitespace_before_semicolons', | |
'no_empty_comment', | |
'no_superfluous_elseif', | |
'single_trait_insert_per_statement', | |
'phpdoc_no_empty_return', | |
'new_with_braces', | |
'yoda_style', | |
'php_unit_test_class_requires_covers' | |
]; | |
$config = PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
'@PhpCsFixer' => true, | |
'list_syntax' => ['syntax' => 'short'], | |
'increment_style' => ['style' => 'post'], | |
] + array_fill_keys($rulesToDisable, false)) | |
->setFinder($finder) | |
; | |
return $config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment