Skip to content

Instantly share code, notes, and snippets.

@akondas
Created November 5, 2019 10:41
Show Gist options
  • Save akondas/a990f9a81b042b0ca87f68d532c848b1 to your computer and use it in GitHub Desktop.
Save akondas/a990f9a81b042b0ca87f68d532c848b1 to your computer and use it in GitHub Desktop.
Sample PHP-CS-Fixer config file
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PHP71Migration' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_unused_imports' => true,
'declare_strict_types' => true,
'ordered_imports' => [
'importsOrder' => null,
'sortAlgorithm' => 'alpha',
],
'phpdoc_order' => true,
'phpdoc_align' => true,
'phpdoc_no_access' => true,
'phpdoc_separation' => true,
'pre_increment' => true,
'single_quote' => true,
'trim_array_spaces' => true,
'single_blank_line_before_namespace' => true,
'yoda_style' => null,
// risky -->
'strict_param' => true,
])
->setFinder($finder)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment