Skip to content

Instantly share code, notes, and snippets.

@ker0x
Created February 23, 2021 10:31
Show Gist options
  • Save ker0x/bad93ffb06a8b2fe2199997f9e48ae2c to your computer and use it in GitHub Desktop.
Save ker0x/bad93ffb06a8b2fe2199997f9e48ae2c to your computer and use it in GitHub Desktop.
Laravel PHP-CS-Fixer configuration
<?php
$rules = [
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
],
'increment_style' => ['style' => 'post'],
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
'use_trait',
]
],
'ordered_imports' => [
'sortAlgorithm' => 'alpha'
],
'single_line_comment_style' => [
'comment_types' => [
'hash'
]
],
];
$finder = PhpCsFixer\Finder::create()
->in([
'app',
'config',
'database',
'resources',
'routes',
'tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
;
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment