diff --git a/CHANGELOG.md b/CHANGELOG.md index ad2ae73..d7be0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## 1.0.1 under development -- no changes in this release. +- Enh #4: Add the `no_empty_statement` rule to `@Yiisoft/Core` (@mspirkov) ## 1.0.0 January 23, 2026 -- Initial release. \ No newline at end of file +- Initial release. diff --git a/rector.php b/rector.php index 54537c2..d545deb 100644 --- a/rector.php +++ b/rector.php @@ -5,20 +5,16 @@ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; -use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; -use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; return RectorConfig::configure() ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', ]) - ->withPhpSets(php81: true) + ->withPhp74Sets() ->withRules([ InlineConstructorDefaultToPropertyRector::class, ]) ->withSkip([ ClosureToArrowFunctionRector::class, - ReadOnlyPropertyRector::class, - NullToStrictStringFuncCallArgRector::class, ]); diff --git a/src/Sets/YiisoftCoreRiskySet.php b/src/Sets/YiisoftCoreRiskySet.php index 48abde4..f31dfc0 100644 --- a/src/Sets/YiisoftCoreRiskySet.php +++ b/src/Sets/YiisoftCoreRiskySet.php @@ -17,8 +17,8 @@ public function getRules(): array { return [ 'declare_strict_types' => true, - 'native_function_invocation' => true, 'native_constant_invocation' => true, + 'native_function_invocation' => true, ]; } diff --git a/src/Sets/YiisoftCoreSet.php b/src/Sets/YiisoftCoreSet.php index da39d7a..dfbc4a1 100644 --- a/src/Sets/YiisoftCoreSet.php +++ b/src/Sets/YiisoftCoreSet.php @@ -17,14 +17,6 @@ public function getRules(): array { return [ '@PER-CS' => true, - 'no_unused_imports' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'curly_brace_block', - 'extra', - ], - ], - 'ordered_class_elements' => true, 'class_attributes_separation' => ['elements' => ['method' => 'one']], 'fully_qualified_strict_types' => [ 'import_symbols' => true, @@ -34,6 +26,15 @@ public function getRules(): array 'import_constants' => true, 'import_functions' => true, ], + 'no_empty_statement' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'curly_brace_block', + 'extra', + ], + ], + 'no_unused_imports' => true, + 'ordered_class_elements' => true, ]; }