-
-
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 used as ArrayDimFetch on Arg on side effect FuncCall on …
…ReadOnlyPropertyRector (#1821) * [Php81] Skip used in CallLike arg on ReadOnlyPropertyRector * rename fixture * use VisibilityManipulator->hasVisibility for Private detection * different method for refactor property * more fixture for Property * [ci-review] Rector Rectify * Fixed 🎉 * [ci-review] Rector Rectify * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
a560205
commit 4cf6522
Showing
5 changed files
with
94 additions
and
14 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
19 changes: 19 additions & 0 deletions
19
...adOnlyPropertyRector/Fixture/skip_used_as_array_dim_fetch_in_side_effect_call_arg.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,19 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
final class SkipUsedAsArrayDimFetchInSideEffectCallArg | ||
{ | ||
/** | ||
* @param array<string, array<string>> $items | ||
*/ | ||
public function __construct(private array $items) | ||
{} | ||
|
||
public function popFooItem(): void | ||
{ | ||
if (!empty($this->items) && array_key_exists('foo', $this->items)) { | ||
array_pop($this->items['foo']); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...dOnlyPropertyRector/Fixture/skip_used_as_array_dim_fetch_in_side_effect_call_arg2.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\Php81\Rector\Property\ReadOnlyPropertyRector\Fixture; | ||
|
||
final class SkipUsedAsArrayDimFetchInSideEffectCallArg2 | ||
{ | ||
private array $items; | ||
|
||
/** | ||
* @param array<string, array<string>> $items | ||
*/ | ||
public function __construct(array $items) | ||
{ | ||
$this->items = $items; | ||
} | ||
|
||
public function popFooItem(): void | ||
{ | ||
if (!empty($this->items) && array_key_exists('foo', $this->items)) { | ||
array_pop($this->items['foo']); | ||
} | ||
} | ||
} |
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
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