Skip to content

Commit 3be8eb6

Browse files
authored
Update cs-fixer to 3.x (#10)
1 parent 09ce256 commit 3be8eb6

File tree

3 files changed

+516
-426
lines changed

3 files changed

+516
-426
lines changed

.php_cs renamed to .php-cs-fixer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
22

3-
return PhpCsFixer\Config::create()
3+
$config = new PhpCsFixer\Config();
4+
5+
return $config
46
->setRules([
57
'@PSR2' => true,
68
'array_syntax' => ['syntax' => 'short'],
7-
'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false],
89
'blank_line_after_opening_tag' => true,
9-
'blank_line_before_return' => true,
10+
'class_attributes_separation' => ['elements' => ['method' => 'one']],
1011
'cast_spaces' => true,
1112
'concat_space' => ['spacing' => 'none'],
1213
'declare_strict_types' => true,
13-
'method_separation' => true,
14+
'increment_style' => ['style' => 'pre'],
1415
'native_function_invocation' => ['include' => ['@all'], 'strict' => false],
1516
'no_blank_lines_after_class_opening' => true,
1617
'no_spaces_around_offset' => ['positions' => ['inside', 'outside']],
@@ -19,15 +20,14 @@
1920
'phpdoc_align' => true,
2021
'phpdoc_no_access' => true,
2122
'phpdoc_separation' => true,
22-
'pre_increment' => true,
2323
'single_quote' => true,
2424
'trim_array_spaces' => true,
2525
'single_blank_line_before_namespace' => true
2626
])
2727
->setFinder(
2828
PhpCsFixer\Finder::create()
29-
->in(__DIR__ . '/src')
30-
->in(__DIR__ . '/tests')
29+
->in(__DIR__.'/src')
30+
->in(__DIR__.'/tests')
3131
)
3232
->setRiskyAllowed(true)
3333
->setUsingCache(false)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"require-dev": {
1111
"phpunit/phpunit": "^9.3",
12-
"friendsofphp/php-cs-fixer": "^2.16",
12+
"friendsofphp/php-cs-fixer": "^3.1",
1313
"phpstan/phpstan": "^0.12.47",
1414
"phpstan/phpstan-phpunit": "^0.12.16"
1515
},

0 commit comments

Comments
 (0)