Skip to content

Instantly share code, notes, and snippets.

@rorymcdaniel
Last active July 2, 2020 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rorymcdaniel/bee368d67a4252e393f04da06ab664c8 to your computer and use it in GitHub Desktop.
Save rorymcdaniel/bee368d67a4252e393f04da06ab664c8 to your computer and use it in GitHub Desktop.
PSR12 php-cs-fixer config
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('somedir')
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'blank_line_after_opening_tag' => true,
'braces' => ['allow_single_line_closure' => true],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'function_typehint_space' => true,
'new_with_braces' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => ['space_before' => 'none'],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
@rorymcdaniel
Copy link
Author

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