-
-
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 named constructor on ReadOnlyPropertyRector (#4359)
* Add fixture for regression test against ReadOnlyPropertyRector This should be used to fix #8012 * rename fixture * FIx * FIx --------- Co-authored-by: Alessandro Lai <alessandro.lai85@gmail.com>
- Loading branch information
1 parent
d630cc6
commit 5e20015
Showing
3 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...Rector/Property/ReadOnlyPropertyRector/Fixture/skip_assigned_in_named_constructor.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,25 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
class SkipAssignedInNamedConstructor | ||
{ | ||
private \DateTimeInterface $date; | ||
|
||
public function __construct() { | ||
$this->date = new \DateTime(); | ||
} | ||
|
||
public function getDate(): \DateTimeInterface | ||
{ | ||
return $this->date; | ||
} | ||
|
||
public static function create(\DateTimeInterface $date): self | ||
{ | ||
$ack = new self(); | ||
$ack->date = $date; | ||
|
||
return $ack; | ||
} | ||
} |
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