|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace ApiClients\Tools\TestUtilities; |
|
4
|
|
|
|
|
5
|
|
|
use PhpCsFixer\Config; |
|
6
|
|
|
|
|
7
|
|
|
final class PhpCsFixerConfig |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @return Config |
|
11
|
|
|
*/ |
|
12
|
1 |
|
public static function create(array $extraRules = []): Config |
|
13
|
|
|
{ |
|
14
|
1 |
|
return Config::create() |
|
15
|
1 |
|
->setRules( |
|
16
|
|
|
[ |
|
17
|
|
|
'@PSR2' => true, |
|
18
|
|
|
'array_syntax' => [ |
|
19
|
|
|
'syntax' => 'short', |
|
20
|
|
|
], |
|
21
|
|
|
'indentation_type' => true, |
|
22
|
|
|
'blank_line_before_return' => true, |
|
23
|
|
|
'declare_strict_types' => true, |
|
24
|
|
|
'method_separation' => true, |
|
25
|
|
|
'new_with_braces' => true, |
|
26
|
|
|
'no_extra_consecutive_blank_lines' => true, |
|
27
|
|
|
'no_leading_import_slash' => true, |
|
28
|
|
|
'no_short_bool_cast' => true, |
|
29
|
|
|
'no_unused_imports' => true, |
|
30
|
|
|
'no_whitespace_before_comma_in_array' => true, |
|
31
|
|
|
'no_whitespace_in_blank_line' => true, |
|
32
|
|
|
'ordered_class_elements' => true, |
|
33
|
|
|
'ordered_imports' => true, |
|
34
|
|
|
'phpdoc_add_missing_param_annotation' => true, |
|
35
|
|
|
'phpdoc_align' => true, |
|
36
|
|
|
'phpdoc_no_empty_return' => true, |
|
37
|
|
|
'phpdoc_order' => true, |
|
38
|
|
|
'phpdoc_scalar' => true, |
|
39
|
|
|
'phpdoc_summary' => true, |
|
40
|
|
|
'return_type_declaration' => true, |
|
41
|
|
|
'single_blank_line_before_namespace' => true, |
|
42
|
|
|
'single_class_element_per_statement' => true, |
|
43
|
|
|
'single_quote' => true, |
|
44
|
|
|
'strict_param' => true, |
|
45
|
|
|
'trailing_comma_in_multiline_array' => true, |
|
46
|
1 |
|
] + $extraRules |
|
47
|
|
|
); |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|