Skip to content

Commit 62fac42

Browse files
committed
rename to RemoveConditionExactReturnRector
1 parent 8530422 commit 62fac42

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/Fixture/allow_any_type.php.inc renamed to rules-tests/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector/Fixture/allow_any_type.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
3+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
44

55
final class AllowAnyType
66
{
@@ -18,7 +18,7 @@ final class AllowAnyType
1818
-----
1919
<?php
2020

21-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
21+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
2222

2323
final class AllowAnyType
2424
{

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/Fixture/allow_equal.php.inc renamed to rules-tests/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector/Fixture/allow_equal.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
3+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
44

55
final class AllowEqual
66
{
@@ -18,7 +18,7 @@ final class AllowEqual
1818
-----
1919
<?php
2020

21-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
21+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
2222

2323
final class AllowEqual
2424
{

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/Fixture/skip_different_return.php.inc renamed to rules-tests/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector/Fixture/skip_different_return.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
3+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
44

55
final class SkipDifferentReturn
66
{

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/Fixture/some_class.php.inc renamed to rules-tests/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector/Fixture/some_class.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
3+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
44

55
final class SomeClass
66
{
@@ -18,7 +18,7 @@ final class SomeClass
1818
-----
1919
<?php
2020

21-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\Fixture;
21+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector\Fixture;
2222

2323
final class SomeClass
2424
{

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/RemoveEmptyArrayConditionReturnRectorTest.php renamed to rules-tests/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector/RemoveEmptyArrayConditionReturnRectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector;
5+
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector;
66

77
use Iterator;
88
use PHPUnit\Framework\Attributes\DataProvider;
99
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
1010

11-
final class RemoveEmptyArrayConditionReturnRectorTest extends AbstractRectorTestCase
11+
final class RemoveConditionExactReturnRectorTest extends AbstractRectorTestCase
1212
{
1313
#[DataProvider('provideData')]
1414
public function test(string $filePath): void
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector;
7+
8+
return RectorConfig::configure()
9+
->withRules([RemoveConditionExactReturnRector::class]);

rules-tests/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector/config/configured_rule.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

rules/DeadCode/Rector/Stmt/RemoveEmptyArrayConditionReturnRector.php renamed to rules/DeadCode/Rector/Stmt/RemoveConditionExactReturnRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* @see \Rector\Tests\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector\RemoveEmptyArrayConditionReturnRectorTest
2121
*/
22-
final class RemoveEmptyArrayConditionReturnRector extends AbstractRector
22+
final class RemoveConditionExactReturnRector extends AbstractRector
2323
{
2424
public function getRuleDefinition(): RuleDefinition
2525
{

src/Config/Level/DeadCodeLevel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
5454
use Rector\DeadCode\Rector\Return_\RemoveDeadConditionAboveReturnRector;
5555
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
56-
use Rector\DeadCode\Rector\Stmt\RemoveEmptyArrayConditionReturnRector;
56+
use Rector\DeadCode\Rector\Stmt\RemoveConditionExactReturnRector;
5757
use Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector;
5858
use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector;
5959
use Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector;
@@ -125,7 +125,7 @@ final class DeadCodeLevel
125125
RemoveDeadCatchRector::class,
126126
RemoveDeadTryCatchRector::class,
127127
RemoveDeadIfForeachForRector::class,
128-
RemoveEmptyArrayConditionReturnRector::class,
128+
RemoveConditionExactReturnRector::class,
129129
RemoveDeadStmtRector::class,
130130
UnwrapFutureCompatibleIfPhpVersionRector::class,
131131
RemoveParentCallWithoutParentRector::class,

0 commit comments

Comments
 (0)