-
-
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.
[TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRect…
…or (#5333) * [TypeDeclaration] Handle assign $this on TypedPropertyFromAssignsRector * fixed * fix namesapce * clean up * [ci-review] Rector Rectify * clean up * clean up * clean up * clean up * clean up * clean up * clean up * clean up --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
043d43c
commit 79c57f0
Showing
3 changed files
with
70 additions
and
8 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
31 changes: 31 additions & 0 deletions
31
...on/Rector/Property/TypedPropertyFromAssignsRector/Fixture/assign_this_become_self.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture; | ||
|
||
final class AssignThisBecomeSelf | ||
{ | ||
private static $instance = null; | ||
|
||
private function __construct() | ||
{ | ||
static::$instance = $this; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture; | ||
|
||
final class AssignThisBecomeSelf | ||
{ | ||
private static ?self $instance = null; | ||
|
||
private function __construct() | ||
{ | ||
static::$instance = $this; | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
...operty/TypedPropertyFromAssignsRector/FixtureComplexTypes/assign_this_become_self.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\FixtureComplexTypes; | ||
|
||
final class AssignThisBecomeSelf | ||
{ | ||
private static $instance = null; | ||
|
||
private function __construct() | ||
{ | ||
static::$instance = $this; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\FixtureComplexTypes; | ||
|
||
final class AssignThisBecomeSelf | ||
{ | ||
private static ?self $instance = null; | ||
|
||
private function __construct() | ||
{ | ||
static::$instance = $this; | ||
} | ||
} | ||
|
||
?> |