-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
70 lines (67 loc) · 2.26 KB
/
.php-cs-fixer.dist.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()
->in(['src', 'tests', 'bin'])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
->append([
'scripts/pathagist',
...glob('*.php'),
...glob('.*.php'),
]);
return (new Config('pathagist'))
->setCacheFile(__DIR__ . '/build/php-cs-fixer/.cache')
->setFinder($finder)
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
'property' => 'one',
],
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'concat_space' => [
'spacing' => 'one',
],
'fully_qualified_strict_types' => true,
'type_declaration_spaces' => true,
'global_namespace_import' => [
'import_classes' => true,
],
'lambda_not_used_import' => true,
'method_argument_space' => [
'after_heredoc' => true,
],
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'object_operator_without_whitespace' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'function', 'const'],
],
'phpdoc_scalar' => [
'types' => ['boolean', 'callback', 'double', 'integer', 'real', 'str'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'single_blank_line_at_eof' => true,
'single_space_around_construct' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'no_singleline_whitespace_before_semicolons' => true,
]);