Skip to content

Commit bc7a659

Browse files
committed
Change CS config
1 parent 6ec6c3e commit bc7a659

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

.php-cs-fixer.dist.php

+48-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,52 @@
11
<?php
22

3-
return JanaSeta\PhpCs\Fix::in([
4-
'src',
3+
$finder = PhpCsFixer\Finder::create()->in([
4+
'src',
55
'tests',
6-
])->addRules([
7-
'@PHP81Migration' => true,
86
]);
7+
8+
return (new PhpCsFixer\Config)->setFinder($finder)
9+
->setIndent("\t")
10+
->setRiskyAllowed(true)
11+
->setLineEnding("\n")
12+
->setRules([
13+
'@PHP80Migration:risky' => true,
14+
'@PHP84Migration' => true,
15+
'@PER-CS2.0' => true,
16+
'@Symfony:risky' => true,
17+
'@Symfony' => true,
18+
19+
// Overrides `@PHP80Migration:risky`
20+
'declare_strict_types' => false,
21+
22+
// Overrides `@PHP84Migration`
23+
'nullable_type_declaration_for_default_null_value' => false,
24+
25+
// Overrides `@Symfony:risky`
26+
'is_null' => false,
27+
28+
// Overrides `@PER-CS2.0`
29+
'new_with_parentheses' => [
30+
'anonymous_class' => false,
31+
'named_class' => false,
32+
],
33+
'trailing_comma_in_multiline' => [
34+
'elements' => ['arrays', 'match', 'parameters'],
35+
],
36+
'control_structure_braces' => false,
37+
'concat_space' => [
38+
'spacing' => 'none',
39+
],
40+
41+
// Overrides `@Symfony`
42+
'phpdoc_summary' => false,
43+
'ordered_imports' => false, //
44+
'global_namespace_import' => false,
45+
'single_line_throw' => false,
46+
// Disabled to allow no separation between interface/abstract methods
47+
'class_attributes_separation' => false,
48+
49+
// Additional
50+
'single_line_empty_body' => true,
51+
]);
52+

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ext-dom": "*",
2525
"ext-mbstring": "*",
2626
"ext-xdebug": "*",
27-
"janaseta/php-cs": "^1.0",
27+
"friendsofphp/php-cs-fixer": "^3.57",
2828
"phpunit/phpunit": "^9.0"
2929
},
3030
"autoload": {

0 commit comments

Comments
 (0)