Skip to content

Commit 7af3e25

Browse files
authored
Replace friendsofphp/php-cs-fixer with yiisoft/code-style (#159)
1 parent 37b1dcf commit 7af3e25

2 files changed

Lines changed: 6 additions & 24 deletions

File tree

.php-cs-fixer.dist.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,20 @@
22

33
declare(strict_types=1);
44

5-
use PhpCsFixer\Config;
65
use PhpCsFixer\Finder;
76
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
7+
use Yiisoft\CodeStyle\ConfigBuilder;
88

99
$finder = (new Finder())->in([
1010
__DIR__ . '/src',
1111
__DIR__ . '/tests',
1212
]);
1313

14-
return (new Config())
14+
return ConfigBuilder::build()
1515
->setRiskyAllowed(true)
1616
->setParallelConfig(ParallelConfigFactory::detect())
1717
->setRules([
18-
'@PER-CS3.0' => true,
19-
'no_unused_imports' => true,
20-
'no_extra_blank_lines' => [
21-
'tokens' => [
22-
'curly_brace_block',
23-
'extra',
24-
],
25-
],
26-
'ordered_class_elements' => true,
27-
'class_attributes_separation' => ['elements' => ['method' => 'one']],
28-
'declare_strict_types' => true,
29-
'native_function_invocation' => true,
30-
'native_constant_invocation' => true,
31-
'fully_qualified_strict_types' => [
32-
'import_symbols' => true
33-
],
34-
'global_namespace_import' => [
35-
'import_classes' => true,
36-
'import_constants' => true,
37-
'import_functions' => true,
38-
],
18+
'@Yiisoft/Core' => true,
19+
'@Yiisoft/Core:risky' => true,
3920
])
4021
->setFinder($finder);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"php": "^8.1"
3232
},
3333
"require-dev": {
34-
"friendsofphp/php-cs-fixer": "^3.89.1",
34+
"friendsofphp/php-cs-fixer": "^3.93",
35+
"yiisoft/code-style": "^1.0",
3536
"maglnet/composer-require-checker": "^4.7.1",
3637
"phpunit/phpunit": "^10.5.46",
3738
"rector/rector": "^2.0.16",

0 commit comments

Comments
 (0)