-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent UnionTypes rule from removing
@param static
in favor fo `se…
…lf`-typed $argument (#1667)
- Loading branch information
Showing
3 changed files
with
59 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
...tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/param_self_return_static.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\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
class ParamSelfReturnStatic | ||
{ | ||
/** | ||
* @param self $arg | ||
* @return static | ||
*/ | ||
public function go(self $arg): static | ||
{ | ||
return $this; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
class ParamSelfReturnStatic | ||
{ | ||
public function go(self $arg): static | ||
{ | ||
return $this; | ||
} | ||
} | ||
|
||
?> |
13 changes: 13 additions & 0 deletions
13
rules-tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/skip_static_param.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\Fixture; | ||
|
||
class SkipStaticParam | ||
{ | ||
/** | ||
* @param static $arg | ||
*/ | ||
public function go(self $arg1) | ||
{ | ||
} | ||
} |