From 2d48d608e0b1d5a4c0f070bab4bbea9edeca4a57 Mon Sep 17 00:00:00 2001 From: Simon Schaufelberger Date: Wed, 13 Aug 2025 21:31:40 +0200 Subject: [PATCH] Use active voice and improve rule definitions --- rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php | 2 +- .../Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php | 2 +- .../Rector/Include_/AbsolutizeRequireAndIncludePathRector.php | 2 +- rules/DeadCode/Rector/Array_/RemoveDuplicatedArrayKeyRector.php | 2 +- rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php | 2 +- .../Rector/FunctionLike/ExceptionHandlerTypehintRector.php | 2 +- rules/Php71/Rector/TryCatch/MultiExceptionCatchRector.php | 2 +- rules/Php72/Rector/While_/WhileEachToForeachRector.php | 2 +- rules/Php73/Rector/ConstFetch/SensitiveConstantNameRector.php | 2 +- rules/Php73/Rector/FuncCall/SensitiveDefineRector.php | 2 +- rules/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php | 2 +- rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php | 2 +- .../FuncCall/RemoveGetClassGetParentClassNoArgsRector.php | 2 +- rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php | 2 +- .../Rector/ClassConstFetch/RenameClassConstFetchRector.php | 2 +- rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php | 2 +- .../Rector/ClassConst/ChangeConstantVisibilityRector.php | 2 +- .../Rector/ClassMethod/ChangeMethodVisibilityRector.php | 2 +- .../Rector/ClassMethod/ExplicitPublicClassMethodRector.php | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php index dbf2b075d8c..d39b107f705 100644 --- a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php +++ b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php @@ -55,7 +55,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'This Rector adds new default arguments in calls of defined methods and class types.', + 'Add new default arguments in calls of defined methods and class types', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php index f9c1b604315..89f841e8c26 100644 --- a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php +++ b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php @@ -37,7 +37,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Replaces defined map of arguments in defined methods and their calls.', + 'Replace defined map of arguments in defined methods and their calls', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php b/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php index 42161a074d7..93a9ae843ec 100644 --- a/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php +++ b/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php @@ -35,7 +35,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'include/require to absolute path. This Rector might introduce backwards incompatible code, when the include/require being changed depends on the current working directory.', + 'Migrate include/require to absolute path. This Rector might introduce backwards incompatible code, when the include/require being changed depends on the current working directory.', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/DeadCode/Rector/Array_/RemoveDuplicatedArrayKeyRector.php b/rules/DeadCode/Rector/Array_/RemoveDuplicatedArrayKeyRector.php index be55499951b..1fc41db12c0 100644 --- a/rules/DeadCode/Rector/Array_/RemoveDuplicatedArrayKeyRector.php +++ b/rules/DeadCode/Rector/Array_/RemoveDuplicatedArrayKeyRector.php @@ -30,7 +30,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { - return new RuleDefinition('Remove duplicated key in defined arrays.', [ + return new RuleDefinition('Remove duplicated key in defined arrays', [ new CodeSample( <<<'CODE_SAMPLE' $item = [ diff --git a/rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php b/rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php index ad05136572e..2cfd85ba834 100644 --- a/rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php +++ b/rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php @@ -47,7 +47,7 @@ public function provideMinPhpVersion(): int public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Changes PHP 4 style constructor to __construct.', + 'Change PHP 4 style constructor to `__construct`', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php70/Rector/FunctionLike/ExceptionHandlerTypehintRector.php b/rules/Php70/Rector/FunctionLike/ExceptionHandlerTypehintRector.php index 67972682539..95bce1deb6f 100644 --- a/rules/Php70/Rector/FunctionLike/ExceptionHandlerTypehintRector.php +++ b/rules/Php70/Rector/FunctionLike/ExceptionHandlerTypehintRector.php @@ -30,7 +30,7 @@ final class ExceptionHandlerTypehintRector extends AbstractRector implements Min public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Change typehint from `Exception` to `Throwable`.', + 'Change typehint from `Exception` to `Throwable`', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php71/Rector/TryCatch/MultiExceptionCatchRector.php b/rules/Php71/Rector/TryCatch/MultiExceptionCatchRector.php index 6ff433c0d70..0fb994cd3e2 100644 --- a/rules/Php71/Rector/TryCatch/MultiExceptionCatchRector.php +++ b/rules/Php71/Rector/TryCatch/MultiExceptionCatchRector.php @@ -26,7 +26,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Changes multi catch of same exception to single one | separated.', + 'Change multiple catch statements of the same exception to a single one `|` separated', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php72/Rector/While_/WhileEachToForeachRector.php b/rules/Php72/Rector/While_/WhileEachToForeachRector.php index aeb07c38731..ef400d36b9a 100644 --- a/rules/Php72/Rector/While_/WhileEachToForeachRector.php +++ b/rules/Php72/Rector/While_/WhileEachToForeachRector.php @@ -35,7 +35,7 @@ public function provideMinPhpVersion(): int public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'each() function is deprecated, use foreach() instead.', + 'Use `foreach()` instead of deprecated `each()`', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php73/Rector/ConstFetch/SensitiveConstantNameRector.php b/rules/Php73/Rector/ConstFetch/SensitiveConstantNameRector.php index 741efa8fbb3..57f661331c3 100644 --- a/rules/Php73/Rector/ConstFetch/SensitiveConstantNameRector.php +++ b/rules/Php73/Rector/ConstFetch/SensitiveConstantNameRector.php @@ -96,7 +96,7 @@ public function provideMinPhpVersion(): int public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Changes case insensitive constants to sensitive ones.', + 'Change case insensitive constants to sensitive ones', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php73/Rector/FuncCall/SensitiveDefineRector.php b/rules/Php73/Rector/FuncCall/SensitiveDefineRector.php index d1b6f22c2a1..057bba1e99d 100644 --- a/rules/Php73/Rector/FuncCall/SensitiveDefineRector.php +++ b/rules/Php73/Rector/FuncCall/SensitiveDefineRector.php @@ -25,7 +25,7 @@ public function provideMinPhpVersion(): int public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Changes case insensitive constants to sensitive ones.', + 'Change case insensitive constant definition to sensitive one', [new CodeSample( <<<'CODE_SAMPLE' define('FOO', 42, true); diff --git a/rules/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php b/rules/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php index bd6b913f282..1a18812fc50 100644 --- a/rules/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php +++ b/rules/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php @@ -39,7 +39,7 @@ public function provideMinPhpVersion(): int public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Change money_format() to equivalent number_format()', + 'Change `money_format()` to equivalent `number_format()`', [ new CodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php b/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php index a327a880b8b..c12253ce959 100644 --- a/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php +++ b/rules/Php82/Rector/New_/FilesystemIteratorSkipDotsRector.php @@ -32,7 +32,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Prior PHP 8.2 FilesystemIterator::SKIP_DOTS was always set and could not be removed, therefore FilesystemIterator::SKIP_DOTS is added in order to keep this behaviour.', + 'Prior PHP 8.2 FilesystemIterator::SKIP_DOTS was always set and could not be removed, therefore FilesystemIterator::SKIP_DOTS is added in order to keep this behaviour', [ new CodeSample( 'new FilesystemIterator(__DIR__, FilesystemIterator::KEY_AS_FILENAME);', diff --git a/rules/Php83/Rector/FuncCall/RemoveGetClassGetParentClassNoArgsRector.php b/rules/Php83/Rector/FuncCall/RemoveGetClassGetParentClassNoArgsRector.php index a3187b7062b..1750c26fc68 100644 --- a/rules/Php83/Rector/FuncCall/RemoveGetClassGetParentClassNoArgsRector.php +++ b/rules/Php83/Rector/FuncCall/RemoveGetClassGetParentClassNoArgsRector.php @@ -23,7 +23,7 @@ final class RemoveGetClassGetParentClassNoArgsRector extends AbstractRector impl public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Replace calls to get_class() and get_parent_class() without arguments with self::class and parent::class.', + 'Replace calls to `get_class()` and `get_parent_class()` without arguments with `self::class` and `parent::class`', [ new CodeSample( <<<'OLD_CODE_SAMPLE' diff --git a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php index aa3bf8a8e82..e22927f40e7 100644 --- a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php +++ b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php @@ -38,7 +38,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Removes defined arguments in defined methods and their calls.', + 'Remove defined arguments in defined methods and their calls', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php index 6fd95cd00e6..9aa17b147da 100644 --- a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php +++ b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php @@ -30,7 +30,7 @@ final class RenameClassConstFetchRector extends AbstractRector implements Config public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Replaces defined class constants in their calls.', + 'Replace defined class constants in their calls', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php index 73216814717..ccb80b81f41 100644 --- a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php +++ b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php @@ -41,7 +41,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Turns defined annotations above properties and methods to their new values.', + 'Turn defined annotations above properties and methods to their new values', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php index f59213f5bd1..f4e46f7b005 100644 --- a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php +++ b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php @@ -34,7 +34,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Change visibility of constant from parent class.', + 'Change visibility of constant from parent class', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php index e85c040e167..99bdc6c9183 100644 --- a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php +++ b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php @@ -36,7 +36,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Change visibility of method from parent class.', + 'Change visibility of method from parent class', [ new ConfiguredCodeSample( <<<'CODE_SAMPLE' diff --git a/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php b/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php index 6fcb83db9f3..ffe9008a3ba 100644 --- a/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php +++ b/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php @@ -24,7 +24,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( - 'Add explicit public method visibility.', + 'Add explicit public method visibility', [ new CodeSample( <<<'CODE_SAMPLE'