-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Skip on Array Destructuring on ReadOnlyPropertyRector (#3030)
Co-authored-by: Elias Häußler <elias@haeussler.dev>
- Loading branch information
1 parent
6902b17
commit 92a5c65
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...ctor/Property/ReadOnlyPropertyRector/Fixture/skip_property_on_array_destructuring.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,24 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
final class SkipPropetyOnArrayDestructuring | ||
{ | ||
public function __construct( | ||
private ?string $accessToken = null, | ||
private ?string $owner = null, | ||
private ?string $name = null, | ||
) { | ||
} | ||
|
||
public function withVcs(string $value) | ||
{ | ||
$clone = clone $this; | ||
$clone->accessToken = $value; | ||
[$clone->owner, $clone->name] = explode('/', $value, 2); | ||
|
||
return $clone; | ||
} | ||
} | ||
|
||
?> |
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