-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Transform] Handle with this->method() from current class on MethodCa…
…llToMethodCallRector (#2531) * Add a test for MethodCallToMethodCall issue with replacing current class method * Add a test for MethodCallToMethodCall issue with replacing current class method * Closes #2530 Fixes rectorphp/rector#7245 * phpstan * clean up * [ci-review] Rector Rectify * clean up Co-authored-by: SelrahcD <c.desneuf@gmail.com> Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
c80d7e1
commit 1a3288b
Showing
3 changed files
with
84 additions
and
12 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...rm/Rector/MethodCall/MethodCallToMethodCallRector/Fixture/with_this_current_class.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,38 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Transform\Rector\MethodCall\MethodCallToMethodCallRector\Fixture; | ||
|
||
class AClass | ||
{ | ||
public function run() | ||
{ | ||
$this->methodFromAClass(); | ||
} | ||
|
||
public function methodFromAClass() | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Transform\Rector\MethodCall\MethodCallToMethodCallRector\Fixture; | ||
|
||
class AClass | ||
{ | ||
public function __construct(private \Rector\Tests\Transform\Rector\MethodCall\MethodCallToMethodCallRector\Fixture\AnotherClass $anotherClass) | ||
{ | ||
} | ||
public function run() | ||
{ | ||
$this->anotherClass->methodFromAnotherClass(); | ||
} | ||
|
||
public function methodFromAClass() | ||
{ | ||
} | ||
} | ||
|
||
?> |
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