-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Skip Union with Interface on RemoveUselessParamTagRector (#…
…1127) * [DeadCode] Skip Union with Interface on RemoveUselessParamTagRector * Fixed 🎉 * [ci-review] Rector Rectify * eol * union type * fix * [ci-review] Rector Rectify * [ci-review] Rector Rectify * add failing fixture for add some comment before param * fix * clean up * clean up * [ci-review] Rector Rectify * rectify * clean up Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
2b09156
commit 8e9ef87
Showing
5 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...de/Rector/ClassMethod/RemoveUselessParamTagRector/Fixture/skip_union_of_interface.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source\SomeInterface; | ||
use Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source\SomeClass; | ||
|
||
class SkipUnionOfInterface { | ||
/** | ||
* @param SomeClass|SomeInterface $someInterface | ||
*/ | ||
public function run(SomeInterface $someInterface) | ||
{ | ||
if (method_exists($someInterface, 'run')) { | ||
$someInterface->run(); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ssMethod/RemoveUselessParamTagRector/Fixture/skip_union_of_interface_with_comment.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source\SomeInterface; | ||
use Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source\SomeClass; | ||
|
||
class SkipUnionOfInterface { | ||
/** | ||
* Some comment | ||
* | ||
* @param SomeClass|SomeInterface $someInterface | ||
*/ | ||
public function run(SomeInterface $someInterface) | ||
{ | ||
if (method_exists($someInterface, 'run')) { | ||
$someInterface->run(); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
rules-tests/DeadCode/Rector/ClassMethod/RemoveUselessParamTagRector/Source/SomeClass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source; | ||
|
||
class SomeClass implements SomeInterface | ||
{ | ||
public function run() | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
rules-tests/DeadCode/Rector/ClassMethod/RemoveUselessParamTagRector/Source/SomeInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector\Source; | ||
|
||
interface SomeInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters