Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
Last active November 8, 2020 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienbourdeau/4fb8cab4d307e0a689ffa8b314e97b4d to your computer and use it in GitHub Desktop.
Save julienbourdeau/4fb8cab4d307e0a689ffa8b314e97b4d to your computer and use it in GitHub Desktop.
Minimalist PHP CS Fixer config for Laravel
<?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