-
-
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.
[Php81] Fix regression skip call by ref on ReadOnlyPropertyRector on …
…non __construct method (#4614) * Create skip_call_by_ref_method_scope.php.inc This PR is a follow-up to #4593. It adds a failing test case to showcase the expected behavior when passing non-readonly properties by reference in a method other than the constructor. See #4593 (comment) for more details. * Remove duplicated namespace * rename fixture * fix #4613 * [ci-review] Rector Rectify * [ci-review] Rector Rectify * fix * [ci-review] Rector Rectify * [ci-review] Rector Rectify * remove unused pass Scope * [ci-review] Rector Rectify * add scope * add scope * [ci-review] Rector Rectify * [ci-review] Rector Rectify --------- Co-authored-by: Elias Häußler <elias@haeussler.dev> Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
0b96adb
commit db03c60
Showing
6 changed files
with
109 additions
and
79 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
21 changes: 21 additions & 0 deletions
21
...hp81/Rector/Property/ReadOnlyPropertyRector/Fixture/skip_call_by_ref_method_scope.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
use Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Source\WithByRefMethod; | ||
|
||
final class SkipCallByRefMethodScope | ||
{ | ||
public function __construct( | ||
private object $output | ||
) { | ||
} | ||
|
||
public function prepare(): void | ||
{ | ||
$obj = new WithByRefMethod(); | ||
$obj->install($this->output); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
rules-tests/Php81/Rector/Property/ReadOnlyPropertyRector/Source/WithByRefMethod.php
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,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Source; | ||
|
||
final class WithByRefMethod | ||
{ | ||
public function install(&$output) | ||
{ | ||
} | ||
} |
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