Skip to content

Commit

Permalink
Remove removeNode() from RemoveDeadReturnRector, merge RemoveLastRetu…
Browse files Browse the repository at this point in the history
…rnRector to RemoveDeadReturnRector (#4085)
  • Loading branch information
TomasVotruba committed Jun 5, 2023
1 parent cdc9e6b commit 2dccbb6
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 317 deletions.
25 changes: 2 additions & 23 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 384 Rules Overview
# 383 Rules Overview

<br>

Expand All @@ -10,7 +10,7 @@

- [CodingStyle](#codingstyle) (34)

- [DeadCode](#deadcode) (45)
- [DeadCode](#deadcode) (44)

- [DependencyInjection](#dependencyinjection) (2)

Expand Down Expand Up @@ -2914,27 +2914,6 @@ Remove variable just to assign value or return value

<br>

### RemoveLastReturnRector

Remove very last `return` that has no meaning

- class: [`Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector`](../rules/DeadCode/Rector/ClassMethod/RemoveLastReturnRector.php)

```diff
function some_function($value)
{
if ($value === 1000) {
return;
}

if ($value) {
- return;
}
}
```

<br>

### RemoveNonExistingVarAnnotationRector

Removes non-existing `@var` annotations above the code
Expand Down
2 changes: 0 additions & 2 deletions config/set/dead-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
Expand Down Expand Up @@ -91,7 +90,6 @@
RemoveUselessVarTagRector::class,

RemoveUnusedPromotedPropertyRector::class,
RemoveLastReturnRector::class,
RemoveJustPropertyFetchForAssignRector::class,
RemoveJustVariableAssignRector::class,

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveLastReturnRector\Fixture;
namespace Rector\Tests\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector\Fixture;

class InClassMethod
{
Expand All @@ -19,7 +19,7 @@ class InClassMethod
-----
<?php

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveLastReturnRector\Fixture;
namespace Rector\Tests\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector\Fixture;

class InClassMethod
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveLastReturnRector\Fixture;
namespace Rector\Tests\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector\Fixture;

final class SkipReturnValue
{
Expand Down
93 changes: 0 additions & 93 deletions rules/DeadCode/Rector/ClassMethod/RemoveLastReturnRector.php

This file was deleted.

Loading

0 comments on commit 2dccbb6

Please sign in to comment.