-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php_cs.dist
80 lines (77 loc) · 2.61 KB
/
.php_cs.dist
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
71
72
73
74
75
76
77
78
79
80
<?php
$finder = PhpCsFixer\Finder::create()
->exclude([
'vendor',
])
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$config = PhpCsFixer\Config::create()
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_before_return' => true,
'class_attributes_separation' => [
'elements' => ['method'],
],
'concat_space' => ['spacing' => 'one'],
'elseif' => true,
'function_typehint_space' => true,
'global_namespace_import' => [
'import_constants' => true,
'import_functions' => true,
],
'hash_to_slash_comment' => true,
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'native_function_type_declaration_casing' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_extra_consecutive_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_null_property_initialization' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'normalize_index_brace' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha'
],
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => [
'replacements' => [
'type' => 'var',
'link' => 'see',
],
],
'phpdoc_scalar' => true,
'phpdoc_separation' => false,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'short_scalar_cast' => true,
'single_quote' => true,
'standardize_increment' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['property', 'method'],
],
'whitespace_after_comma_in_array' => true,
])
->setFinder($finder);
return $config;