From ccf8fccf9f45a4d5e125bff42e8c1c405a56a71a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 9 Mar 2019 13:08:21 +0000 Subject: [PATCH] rename ConstantReplacerRector to RenameConstantRector --- config/level/database-migration/mysql-to-mysqli.yaml | 2 +- config/level/framework-migration/nette-to-symfony.yaml | 2 +- config/level/nikic/php-parser40.yaml | 2 +- config/level/symfony/symfony30.yaml | 2 +- docs/AllRectorsOverview.md | 10 +++++----- ...tantReplacerRector.php => RenameConstantRector.php} | 2 +- .../Fixture/fixture.php.inc | 4 ++-- .../Fixture/spaghetti.php.inc | 4 ++-- .../RenameConstantRectorTest.php} | 8 ++++---- 9 files changed, 18 insertions(+), 18 deletions(-) rename packages/Php/src/Rector/ConstFetch/{ConstantReplacerRector.php => RenameConstantRector.php} (96%) rename packages/Php/tests/Rector/ConstFetch/{ConstantReplacerRector => RenameConstantRector}/Fixture/fixture.php.inc (58%) rename packages/Php/tests/Rector/ConstFetch/{ConstantReplacerRector => RenameConstantRector}/Fixture/spaghetti.php.inc (62%) rename packages/Php/tests/Rector/ConstFetch/{ConstantReplacerRector/ConstantReplacerRectorTest.php => RenameConstantRector/RenameConstantRectorTest.php} (68%) diff --git a/config/level/database-migration/mysql-to-mysqli.yaml b/config/level/database-migration/mysql-to-mysqli.yaml index ac342864701..16c422de25a 100644 --- a/config/level/database-migration/mysql-to-mysqli.yaml +++ b/config/level/database-migration/mysql-to-mysqli.yaml @@ -51,7 +51,7 @@ services: # http://php.net/manual/en/mysql.constants.php ↓ # http://php.net/manual/en/mysqli.constants.php - Rector\Php\Rector\ConstFetch\ConstantReplacerRector: + Rector\Php\Rector\ConstFetch\RenameConstantRector: MYSQL_ASSOC: 'MYSQLI_ASSOC' MYSQL_NUM: 'MYSQLI_NUM' MYSQL_BOTH: 'MYSQLI_BOTH' diff --git a/config/level/framework-migration/nette-to-symfony.yaml b/config/level/framework-migration/nette-to-symfony.yaml index 484c8506353..40ab005c609 100644 --- a/config/level/framework-migration/nette-to-symfony.yaml +++ b/config/level/framework-migration/nette-to-symfony.yaml @@ -43,7 +43,7 @@ services: # Removes "implements IPresenter" - Nette\Application\IPresenter - Rector\Rector\Constant\ClassConstantReplacerRector: + Rector\Rector\Constant\RenameClassConstantRector: Nette\Http\*Response: S100_CONTINUE: Symfony\Component\HttpFoundation\Response::HTTP_CONTINUE S101_SWITCHING_PROTOCOLS: Symfony\Component\HttpFoundation\Response::HTTP_SWITCHING_PROTOCOLS diff --git a/config/level/nikic/php-parser40.yaml b/config/level/nikic/php-parser40.yaml index e6c4c150a7b..ae9e2fb62d4 100644 --- a/config/level/nikic/php-parser40.yaml +++ b/config/level/nikic/php-parser40.yaml @@ -14,7 +14,7 @@ services: 'PhpParser\Node\Stmt\Property': 'type': 'flags' - Rector\Rector\Constant\ClassConstantReplacerRector: + Rector\Rector\Constant\RenameClassConstantRector: 'PhpParser\Node\Stmt\Class_': 'VISIBILITY_MODIFER_MASK': 'VISIBILITY_MODIFIER_MASK' diff --git a/config/level/symfony/symfony30.yaml b/config/level/symfony/symfony30.yaml index 1acfd2745a1..990d6ce4b62 100644 --- a/config/level/symfony/symfony30.yaml +++ b/config/level/symfony/symfony30.yaml @@ -10,7 +10,7 @@ services: Rector\Symfony\Rector\MethodCall\CascadeValidationFormBuilderRector: ~ # general - Rector\Rector\Constant\ClassConstantReplacerRector: + Rector\Rector\Constant\RenameClassConstantRector: # form 'Symfony\Component\Form\FormEvents': 'PRE_BIND': 'PRE_SUBMIT' diff --git a/docs/AllRectorsOverview.md b/docs/AllRectorsOverview.md index c3770908405..78e9cc5caee 100644 --- a/docs/AllRectorsOverview.md +++ b/docs/AllRectorsOverview.md @@ -1927,9 +1927,9 @@ Changes unquoted non-existing constants to strings
-### `ConstantReplacerRector` +### `RenameConstantRector` -- class: `Rector\Php\Rector\ConstFetch\ConstantReplacerRector` +- class: `Rector\Php\Rector\ConstFetch\RenameConstantRector` Replace constant by new ones @@ -4485,15 +4485,15 @@ services:
-### `ClassConstantReplacerRector` +### `RenameClassConstantRector` -- class: `Rector\Rector\Constant\ClassConstantReplacerRector` +- class: `Rector\Rector\Constant\RenameClassConstantRector` Replaces defined class constants in their calls. ```yaml services: - Rector\Rector\Constant\ClassConstantReplacerRector: + Rector\Rector\Constant\RenameClassConstantRector: SomeClass: OLD_CONSTANT: NEW_CONSTANT OTHER_OLD_CONSTANT: 'DifferentClass::NEW_CONSTANT' diff --git a/packages/Php/src/Rector/ConstFetch/ConstantReplacerRector.php b/packages/Php/src/Rector/ConstFetch/RenameConstantRector.php similarity index 96% rename from packages/Php/src/Rector/ConstFetch/ConstantReplacerRector.php rename to packages/Php/src/Rector/ConstFetch/RenameConstantRector.php index 3b266487d8f..2819a5189b2 100644 --- a/packages/Php/src/Rector/ConstFetch/ConstantReplacerRector.php +++ b/packages/Php/src/Rector/ConstFetch/RenameConstantRector.php @@ -9,7 +9,7 @@ use Rector\Rector\AbstractRector; use Rector\RectorDefinition\CodeSample; use Rector\RectorDefinition\RectorDefinition; -final class ConstantReplacerRector extends AbstractRector +final class RenameConstantRector extends AbstractRector { /** * @var string[] diff --git a/packages/Php/tests/Rector/ConstFetch/ConstantReplacerRector/Fixture/fixture.php.inc b/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/Fixture/fixture.php.inc similarity index 58% rename from packages/Php/tests/Rector/ConstFetch/ConstantReplacerRector/Fixture/fixture.php.inc rename to packages/Php/tests/Rector/ConstFetch/RenameConstantRector/Fixture/fixture.php.inc index feb87450ec8..0c643ca8f6d 100644 --- a/packages/Php/tests/Rector/ConstFetch/ConstantReplacerRector/Fixture/fixture.php.inc +++ b/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/Fixture/fixture.php.inc @@ -1,6 +1,6 @@