-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8e2db7
commit 055c39c
Showing
4 changed files
with
106 additions
and
15 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...lassMethod/ReturnTypeFromReturnNewRector/Fixture/skip_double_assigned_to_variable.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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector\Fixture; | ||
|
||
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector\Source\SomeResponse; | ||
|
||
final class SkipDoubleAssignedToVariable | ||
{ | ||
public function action() | ||
{ | ||
$ambiguousResponse = new SomeResponse(); | ||
|
||
$ambiguousResponse = 5000; | ||
|
||
return $ambiguousResponse; | ||
} | ||
} |
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
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
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\TypeDeclaration\ValueObject; | ||
|
||
use PhpParser\Node\Expr; | ||
use PhpParser\Node\Expr\Variable; | ||
|
||
final class AssignToVariable | ||
{ | ||
public function __construct( | ||
private Variable $variable, | ||
private string $variableName, | ||
private Expr $assignedExpr | ||
) { | ||
} | ||
|
||
public function getVariable(): Variable | ||
{ | ||
return $this->variable; | ||
} | ||
|
||
public function getVariableName(): string | ||
{ | ||
return $this->variableName; | ||
} | ||
|
||
public function getAssignedExpr(): Expr | ||
{ | ||
return $this->assignedExpr; | ||
} | ||
} |