Skip to content

Instantly share code, notes, and snippets.

@innocenzi
Created September 23, 2020 08:59
Show Gist options
  • Save innocenzi/6e4867d4775ed72b7ac89403d5178926 to your computer and use it in GitHub Desktop.
Save innocenzi/6e4867d4775ed72b7ac89403d5178926 to your computer and use it in GitHub Desktop.
Configurations pour Prettier et CS Fixer
<?php
$finder = PhpCsFixer\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'ordered_imports' => true,
'yoda_style' => true,
'concat_space' => ['spacing' => 'one'],
'single_line_throw' => false,
'no_leading_import_slash' => true,
'no_alternative_syntax' => true,
'native_function_casing' => true,
'native_function_type_declaration_casing' => true,
'native_function_invocation' => [
'include' => ['@all'],
'scope' => 'all',
],
'native_constant_invocation' => [
'scope' => 'all',
],
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'class_attributes_separation' => [
'elements' => ['method'],
],
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
],
],
])
->setFinder($finder);
{
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "all",
"singleQuote": true,
"arrowParens": "always",
"useTabs": true,
"semi": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment