-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Skip ArrayDimFetch from ArrayObject in Assign var on ReadOnly…
…PropertyRector (#2363) * [Php81] Skip ArrayDimFetch from ArrayObject in Assign var on ReadOnlyPropertyRector * Fixed 🎉 * eol
- Loading branch information
1 parent
66dbb1e
commit 3da22b0
Showing
2 changed files
with
23 additions
and
3 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
20 changes: 20 additions & 0 deletions
20
...adOnlyPropertyRector/Fixture/skip_array_dim_fetch_from_array_object_in_assign_var.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,20 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
use ArrayObject; | ||
|
||
final class SkipArrayDimFetchFromArrayObjectInAssignVar | ||
{ | ||
private ArrayObject $array; | ||
|
||
public function __construct() | ||
{ | ||
$this->array = new ArrayObject(); | ||
} | ||
|
||
public function getOrSet(int|string $key, mixed $value = null): mixed | ||
{ | ||
return $this->array[$key] ??= $value; | ||
} | ||
} |