-
-
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.
Fix make ReadOnlyPropertyRector skip if traits are used, as not relia…
…ble (#5548) * Added test case property declared readonly when only set in trait * make ReadOnlyPropertyRector skip if traits are used, as not reliable --------- Co-authored-by: David Grüner <david@vworld.at>
- Loading branch information
1 parent
b0ad364
commit 06fa177
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...Php81/Rector/Property/ReadOnlyPropertyRector/Fixture/skip_write_in_trait_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,22 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
use stdClass; | ||
|
||
final class SkipWriteInTraitProperty | ||
{ | ||
use WritableTrait; | ||
|
||
public function __construct(private stdClass $myProperty) | ||
{ | ||
} | ||
} | ||
|
||
trait WritableTrait | ||
{ | ||
public function setProperty(stdClass $myProperty): void | ||
{ | ||
$this->myProperty = $myProperty; | ||
} | ||
} |
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