-
-
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] Handle crash on has first class callable on RemoveUnusedCo…
…nstructorParamRector (#3015) * [DeadCode] Handle has first class callable on RemoveUnusedConstructorParamRector * Fixed 🎉 * final touch: more fixture
- Loading branch information
1 parent
d82ef17
commit b46d5f5
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...r/ClassMethod/RemoveUnusedConstructorParamRector/Fixture/has_first_class_callable.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,43 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector\Fixture; | ||
|
||
final class HasFirstClassCallable | ||
{ | ||
private $hey; | ||
|
||
public function __construct($hey, $man) | ||
{ | ||
$this->hey = $hey; | ||
|
||
$this->execute(...); | ||
} | ||
|
||
private function execute() | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector\Fixture; | ||
|
||
final class HasFirstClassCallable | ||
{ | ||
private $hey; | ||
|
||
public function __construct($hey) | ||
{ | ||
$this->hey = $hey; | ||
|
||
$this->execute(...); | ||
} | ||
|
||
private function execute() | ||
{ | ||
} | ||
} | ||
|
||
?> |
20 changes: 20 additions & 0 deletions
20
...RemoveUnusedConstructorParamRector/Fixture/skip_used_by_exec_first_class_callable.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 | ||
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector\Fixture; | ||
|
||
final class SkipUsedByExecFirstClassCallable | ||
{ | ||
private $hey; | ||
|
||
public function __construct($hey, $man) | ||
{ | ||
$this->hey = $hey; | ||
|
||
$this->execute(...)($man); | ||
} | ||
|
||
private function execute($man) | ||
{ | ||
echo $man; | ||
} | ||
} |
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