-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Skip multiple assign on __construct on ReadOnlyPropertyRector (…
…#2088) * [Php81] Skip multiple assign on __construct on ReadOnlyPropertyRector * Fixed 🎉 * final touch: check multi assign on last check * final touch: eol * final touch: stop traversal when count already = 2 * final touch: check only in __construct * [ci-review] Rector Rectify * [ci-review] Rector Rectify * really final touch: ensure parent ClassLike is equals with the property ClassLike * really final touch: ensure parent ClassLike is equals with the property ClassLike Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
996caa3
commit c7ff218
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...s-tests/Php81/Rector/Property/ReadOnlyPropertyRector/Fixture/skip_multiple_assign.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 | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
final class SkipMultipleAssign | ||
{ | ||
private string $name; | ||
|
||
public function __construct(string $name, bool $flag = true) | ||
{ | ||
$this->name = $name; | ||
|
||
if ($flag) { | ||
$this->name = 'change'; | ||
} | ||
|
||
if ($flag) { | ||
$this->name = 'change again'; | ||
} | ||
} | ||
} |
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