This repository has been archived by the owner on Aug 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.php_cs
43 lines (40 loc) · 1.76 KB
/
.php_cs
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 = PhpCsFixer\Finder::create()
->notPath('bootstrap/cache')
->notPath('node_modules')
->notPath('public')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return PhpCsFixer\Config::create()
->setRules([
'@PSR1' => false,
'@PSR2' => true,
// Logical NOT operators (!) should have one trailing whitespace.
'not_operator_with_successor_space' => true,
// PHP multi-line arrays should have a trailing comma.
'trailing_comma_in_multiline_array' => true,
// Ordering use statements.
'ordered_imports' => true,
// Removes extra blank lines and/or blank lines following configuration.
'no_extra_blank_lines' => ['use'],
// An empty line feed should precede a return statement.
'blank_line_before_return' => true,
// PHP arrays should be declared using the configured syntax.
'array_syntax' => ['syntax' => 'short'],
// Cast (boolean) and (integer) should be written as (bool) and (int), (double) and (real) as (float), (binary) as (string).
'short_scalar_cast' => true,
// PHP single-line arrays should not have trailing comma.
'no_trailing_comma_in_singleline_array' => true,
// Arrays should be formatted like function/method arguments, without leading or trailing single line space.
'trim_array_spaces' => true,
// Binary operators should be surrounded by space as configured.
'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false],
// Unused use statements must be removed.
'no_unused_imports' => true,
])
->setFinder($finder)
->setUsingCache(true);