-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Handle Nullable Type and under intanceof for RemoveUnus…
…edAliasRector (#784)
- Loading branch information
1 parent
541e40b
commit dd49d38
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
rules-tests/CodingStyle/Rector/Use_/RemoveUnusedAliasRector/Fixture/nullable_alias.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Source\AbstractKernel as BaseKernel; | ||
|
||
class SomeClass | ||
{ | ||
public function run(?BaseKernel $baseKernel) | ||
{ | ||
$anotherBaseKernel = $baseKernel ?? new BaseKernel(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Source\AbstractKernel; | ||
|
||
class SomeClass | ||
{ | ||
public function run(?AbstractKernel $baseKernel) | ||
{ | ||
$anotherBaseKernel = $baseKernel ?? new AbstractKernel(); | ||
} | ||
} | ||
|
||
?> |
33 changes: 33 additions & 0 deletions
33
rules-tests/CodingStyle/Rector/Use_/RemoveUnusedAliasRector/Fixture/under_intanceof.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Source\AbstractKernel as BaseKernel; | ||
|
||
class UnderInstanceOf | ||
{ | ||
public function run(?BaseKernel $baseKernel) | ||
{ | ||
if ($baseKernel instanceof BaseKernel) { | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\Use_\RemoveUnusedAliasRector\Source\AbstractKernel; | ||
|
||
class UnderInstanceOf | ||
{ | ||
public function run(?AbstractKernel $baseKernel) | ||
{ | ||
if ($baseKernel instanceof AbstractKernel) { | ||
} | ||
} | ||
} | ||
|
||
?> |
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