Skip to content

Instantly share code, notes, and snippets.

@rydurham
Last active May 1, 2019 02:47
Show Gist options
  • Save rydurham/76b5e1ac20380ae80d7524f04b70ad50 to your computer and use it in GitHub Desktop.
Save rydurham/76b5e1ac20380ae80d7524f04b70ad50 to your computer and use it in GitHub Desktop.
Laravel PHP CS config
<?php
$finder = Symfony\Component\Finder\Finder::create()
->exclude('vendor')
->exclude('bootstrap')
->exclude('storage')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php');
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'length'],
'no_unused_imports' => true,
'linebreak_after_opening_tag' => true,
'not_operator_with_successor_space' => true,
'phpdoc_order' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_align' => ['align' => 'left']
])
->setFinder($finder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment