-
Notifications
You must be signed in to change notification settings - Fork 41
/
.php-cs-fixer.php
43 lines (39 loc) · 1.31 KB
/
.php-cs-fixer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$finder = Symfony\Component\Finder\Finder::create()
->exclude(['vendor'])
->name('*.php')
->in(__DIR__);
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'strict_param' => false,
'no_unused_imports' => true,
'indentation_type' => true,
'array_indentation' => false,
'single_quote' => true,
'method_chaining_indentation' => true,
'trim_array_spaces' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'operators' => [
'=>' => 'single_space',
'=' => 'single_space',
'+=' => 'single_space',
'-=' => 'single_space',
'>' => 'single_space',
'<' => 'single_space',
'<=' => 'single_space',
'>=' => 'single_space',
'||' => 'single_space',
'&&' => 'single_space',
],
],
'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'return', 'switch', 'throw', 'try']],
// This is just prettier / easier to read.
'concat_space' => ['spacing' => 'one'],
// Visibility annotations are not supported by php5.6
'visibility_required' => false,
])
->setIndent(str_pad('', 4))
->setLineEnding("\n")
->setFinder($finder);