rename ConstantReplacerRector to RenameConstantRector

This commit is contained in:
Tomas Votruba 2019-03-09 13:08:21 +00:00
parent 02836ab9c3
commit ccf8fccf9f
9 changed files with 18 additions and 18 deletions

View File

@ -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'

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -1927,9 +1927,9 @@ Changes unquoted non-existing constants to strings
<br>
### `ConstantReplacerRector`
### `RenameConstantRector`
- class: `Rector\Php\Rector\ConstFetch\ConstantReplacerRector`
- class: `Rector\Php\Rector\ConstFetch\RenameConstantRector`
Replace constant by new ones
@ -4485,15 +4485,15 @@ services:
<br>
### `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'

View File

@ -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[]

View File

@ -1,6 +1,6 @@
<?php
namespace Rector\Php\Tests\Rector\ConstFetch\ConstantReplacerRector\Fixture;
namespace Rector\Php\Tests\Rector\ConstFetch\RenameConstantRector\Fixture;
final class SomeClass
{
@ -14,7 +14,7 @@ final class SomeClass
-----
<?php
namespace Rector\Php\Tests\Rector\ConstFetch\ConstantReplacerRector\Fixture;
namespace Rector\Php\Tests\Rector\ConstFetch\RenameConstantRector\Fixture;
final class SomeClass
{

View File

@ -1,6 +1,6 @@
<?php
namespace Rector\Php\Tests\Rector\ConstFetch\ConstantReplacerRector\Fixture;
namespace Rector\Php\Tests\Rector\ConstFetch\RenameConstantRector\Fixture;
final class Spaghetti
{
@ -14,7 +14,7 @@ final class Spaghetti
-----
<?php
namespace Rector\Php\Tests\Rector\ConstFetch\ConstantReplacerRector\Fixture;
namespace Rector\Php\Tests\Rector\ConstFetch\RenameConstantRector\Fixture;
final class Spaghetti
{

View File

@ -1,11 +1,11 @@
<?php declare(strict_types=1);
namespace Rector\Php\Tests\Rector\ConstFetch\ConstantReplacerRector;
namespace Rector\Php\Tests\Rector\ConstFetch\RenameConstantRector;
use Rector\Php\Rector\ConstFetch\ConstantReplacerRector;
use Rector\Php\Rector\ConstFetch\RenameConstantRector;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
final class ConstantReplacerRectorTest extends AbstractRectorTestCase
final class RenameConstantRectorTest extends AbstractRectorTestCase
{
public function test(): void
{
@ -14,7 +14,7 @@ final class ConstantReplacerRectorTest extends AbstractRectorTestCase
protected function getRectorClass(): string
{
return ConstantReplacerRector::class;
return RenameConstantRector::class;
}
/**