-
-
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.
Refactor RenameVariableToMatchMethodCallReturnTypeRector to StmtsAwar…
…eInterface (#3977)
- Loading branch information
1 parent
bb3d37a
commit 33d05d3
Showing
29 changed files
with
223 additions
and
249 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
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
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
31 changes: 0 additions & 31 deletions
31
...tor/Assign/RenameVariableToMatchMethodCallReturnTypeRector/Fixture/arrow_function.php.inc
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...Assign/RenameVariableToMatchMethodCallReturnTypeRector/Fixture/double_method_call.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,49 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector\Fixture; | ||
|
||
use PhpParser\Node\Expr\ClassConstFetch; | ||
|
||
final class DoubleMethodCall | ||
{ | ||
public function run() | ||
{ | ||
$magicGet = $this->createClassConstFetch('SomeClass', 'MAGIC_GET'); | ||
echo $magicGet; | ||
|
||
$magicSet = $this->createClassConstFetch('SomeClass', 'MAGIC_SET'); | ||
echo $magicSet; | ||
} | ||
|
||
protected function createClassConstFetch(string $class, string $constant): ClassConstFetch | ||
{ | ||
return new ClassConstFetch($class, $constant); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector\Fixture; | ||
|
||
use PhpParser\Node\Expr\ClassConstFetch; | ||
|
||
final class DoubleMethodCall | ||
{ | ||
public function run() | ||
{ | ||
$classConstFetch = $this->createClassConstFetch('SomeClass', 'MAGIC_GET'); | ||
echo $classConstFetch; | ||
|
||
$magicSet = $this->createClassConstFetch('SomeClass', 'MAGIC_SET'); | ||
echo $magicSet; | ||
} | ||
|
||
protected function createClassConstFetch(string $class, string $constant): ClassConstFetch | ||
{ | ||
return new ClassConstFetch($class, $constant); | ||
} | ||
} | ||
|
||
?> |
13 changes: 13 additions & 0 deletions
13
...ssign/RenameVariableToMatchMethodCallReturnTypeRector/Fixture/skip_arrow_function.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\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector\Fixture; | ||
|
||
use Rector\Tests\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector\Source\SameNameMethod; | ||
|
||
final class SkipArrowFunction | ||
{ | ||
public function run(SameNameMethod $sameNameMethod) | ||
{ | ||
$fn1 = fn($x) => $x + $stamp = $sameNameMethod->getName(); | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
...n/RenameVariableToMatchMethodCallReturnTypeRector/Fixture/skip_double_method_call.php.inc
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.