Skip to content

Instantly share code, notes, and snippets.

@IamSwap
Last active August 30, 2018 14:22
Show Gist options
  • Save IamSwap/d09cd76382e07c30d7f51bb7e536fa88 to your computer and use it in GitHub Desktop.
Save IamSwap/d09cd76382e07c30d7f51bb7e536fa88 to your computer and use it in GitHub Desktop.
PHP CS fixer Configuration for Laravel
<?php
/**
* Config for PHP-CS-Fixer ver2
*/
$rules = [
'@PSR2' => true,
// addtional rules
'array_syntax' => ['syntax' => 'short'],
'no_multiline_whitespace_before_semicolons' => true,
'no_short_echo_tag' => true,
'no_unused_imports' => true,
'ordered_imports' => ['sortAlgorithm' => 'length'],
'not_operator_with_successor_space' => true,
];
$excludes = [
// add exclude project directory
'vendor',
'node_modules',
];
return PhpCsFixer\Config::create()
->setRules($rules)
->setFinder(
PhpCsFixer\Finder::create()
->exclude($excludes)
->notName('README.md')
->notName('*.xml')
->notName('*.yml')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment