Skip to content

Instantly share code, notes, and snippets.

@dimitriacosta
Created September 3, 2018 07:47
Show Gist options
  • Save dimitriacosta/aea1cedaf4e0fb09fd4a15c5f4771a2b to your computer and use it in GitHub Desktop.
Save dimitriacosta/aea1cedaf4e0fb09fd4a15c5f4771a2b to your computer and use it in GitHub Desktop.
Custom configuration for php-cs-fixer
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => null,
'sort_algorithm' => 'length',
],
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'ternary_operator_spaces' => true,
'method_chaining_indentation' => true,
'binary_operator_spaces' => [
'operators' => [
'=' => 'single_space',
'=>' => 'single_space',
],
],
'switch_case_space' => true,
'concat_space' => [
'spacing' => 'one',
],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment