Skip to content

Instantly share code, notes, and snippets.

@jenky
Last active July 12, 2018 08:18
Show Gist options
  • Save jenky/fe61d02084bf146a1dc34a0687f8cb46 to your computer and use it in GitHub Desktop.
Save jenky/fe61d02084bf146a1dc34a0687f8cb46 to your computer and use it in GitHub Desktop.
Laravel PHP-CS-Fixer 2 config
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('bootstrap/cache')
->exclude('storage')
->exclude('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
;
return PhpCsFixer\Config::create()
->setCacheFile(__DIR__.'/.php_cs.cache')
->setRules(array(
'@PSR2' => true,
'blank_line_after_opening_tag' => true,
'function_typehint_space' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'ternary_operator_spaces' => true,
))
->setFinder($finder)
;
@PhouvanhKCSV
Copy link

I got this error message on PHP CS Fixer 2.8.2 Round Numbers.

[LogicException]
You must call one of in() or append() methods before iterating over a Finder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment