Skip to content

Commit 3044451

Browse files
committed
Use config from api-clients/cs-fixer-config
1 parent 372f132 commit 3044451

File tree

3 files changed

+45
-35
lines changed

3 files changed

+45
-35
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"require": {
1212
"php": "^7.2",
13+
"api-clients/cs-fixer-config": "^1.0",
1314
"clue/block-react": "^1.1",
1415
"friendsofphp/php-cs-fixer": "^2.5",
1516
"infection/infection": "^0.8.2",

composer.lock

Lines changed: 41 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpCsFixerConfig.php

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,17 @@
22

33
namespace ApiClients\Tools\TestUtilities;
44

5+
use ApiClients\Tools\CsFixerConfig\PhpCsFixerConfig as CSFC;
56
use PhpCsFixer\Config;
67

78
final class PhpCsFixerConfig
89
{
910
/**
1011
* @return Config
12+
* @deprecated use ApiClients\Tools\CsFixerConfig\PhpCsFixerConfig directly
1113
*/
1214
public static function create(array $extraRules = []): Config
1315
{
14-
return Config::create()
15-
->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-
] + $extraRules
47-
);
16+
return CSFC::create($extraRules);
4817
}
4918
}

0 commit comments

Comments
 (0)