diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 92c8559..2477e66 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,39 +2,20 @@ declare(strict_types=1); -use PhpCsFixer\Config; use PhpCsFixer\Finder; use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; +use Yiisoft\CodeStyle\ConfigBuilder; $finder = (new Finder())->in([ __DIR__ . '/src', __DIR__ . '/tests', ]); -return (new Config()) +return ConfigBuilder::build() ->setRiskyAllowed(true) ->setParallelConfig(ParallelConfigFactory::detect()) ->setRules([ - '@PER-CS3.0' => true, - 'no_unused_imports' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'curly_brace_block', - 'extra', - ], - ], - 'ordered_class_elements' => true, - 'class_attributes_separation' => ['elements' => ['method' => 'one']], - 'declare_strict_types' => true, - 'native_function_invocation' => true, - 'native_constant_invocation' => true, - 'fully_qualified_strict_types' => [ - 'import_symbols' => true - ], - 'global_namespace_import' => [ - 'import_classes' => true, - 'import_constants' => true, - 'import_functions' => true, - ], + '@Yiisoft/Core' => true, + '@Yiisoft/Core:risky' => true, ]) ->setFinder($finder); diff --git a/composer.json b/composer.json index 0f3fbaa..1c97ba2 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "php": "^8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.89.1", + "friendsofphp/php-cs-fixer": "^3.93", + "yiisoft/code-style": "^1.0", "maglnet/composer-require-checker": "^4.7.1", "phpunit/phpunit": "^10.5.46", "rector/rector": "^2.0.16",