-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle readonly class with attrs (#5736)
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...-tests/Php82/Rector/Class_/ReadOnlyClassRector/Fixture/with_attribute_on_property.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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php82\Rector\Class_\ReadOnlyClassRector\Fixture; | ||
|
||
final class WithAttributeOnProperty | ||
{ | ||
#[MyAttr] | ||
public readonly string $id; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php82\Rector\Class_\ReadOnlyClassRector\Fixture; | ||
|
||
final readonly class WithAttributeOnProperty | ||
{ | ||
#[MyAttr] | ||
public string $id; | ||
} | ||
|
||
?> |
27 changes: 27 additions & 0 deletions
27
...82/Rector/Class_/ReadOnlyClassRector/Fixture/with_attribute_on_property_promotion.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,27 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php82\Rector\Class_\ReadOnlyClassRector\Fixture; | ||
|
||
final class WithAttributeOnPropertyPromotion | ||
{ | ||
private function __construct( | ||
#[MyAttr] | ||
private readonly string $id | ||
){} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php82\Rector\Class_\ReadOnlyClassRector\Fixture; | ||
|
||
final readonly class WithAttributeOnPropertyPromotion | ||
{ | ||
private function __construct( | ||
#[MyAttr] | ||
private string $id | ||
){} | ||
} | ||
|
||
?> |
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