Skip to content

Instantly share code, notes, and snippets.

@mattias-persson
Last active September 7, 2020 04:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattias-persson/1be2f0537eab4ca5fb0ca0e788ec5a3d to your computer and use it in GitHub Desktop.
Save mattias-persson/1be2f0537eab4ca5fb0ca0e788ec5a3d to your computer and use it in GitHub Desktop.
StyleCI Laravel Preset config for PhpCsFixer
<?php
return PhpCsFixer\Config::create()
->setRules([
'psr0' => false,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'phpdoc_indent' => true,
'cast_spaces' => ['space' => 'single'],
'binary_operator_spaces' => [],
'unary_operator_spaces' => [],
'phpdoc_scalar' => ['types' => ['boolean', 'callback', 'double', 'integer', 'real', 'str']],
'standardize_not_equals' => true,
'no_unused_imports' => true,
'whitespace_after_comma_in_array' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_whitespace_in_comment' => true,
'no_whitespace_in_blank_line' => true,
'no_whitespace_before_comma_in_array' => true,
'no_trailing_comma_in_singleline_array' => true,
'trailing_comma_in_multiline_array' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment