Skip to content

Instantly share code, notes, and snippets.

@isuzuki
Last active September 26, 2022 19:58
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save isuzuki/5fd0177993cca7a5fd15ad09be27d706 to your computer and use it in GitHub Desktop.
Save isuzuki/5fd0177993cca7a5fd15ad09be27d706 to your computer and use it in GitHub Desktop.
Config for PHP-CS-Fixer ver 2 (based on laravel .php_cs https://github.com/laravel/framework/blob/5.4/.php_cs)
<?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,
'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')
);
@Braunson
Copy link

Thank you!

@ifaniqbal
Copy link

Thanks!

@JeffreyNaval
Copy link

Thanks!

@Ishidall
Copy link

Thank you!

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