-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBraces…
…Rector (#6533) * [Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBracesRector * check only on variable, ensure patch on target
- Loading branch information
1 parent
cbc295a
commit 7060593
Showing
3 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...leNameInCurlyBracesRector/Fixture/skip_wrapped_array_dim_fetch_variable_variables.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector\Fixture; | ||
|
||
final class SkipWrappedArrayDimFetchVariableVariables | ||
{ | ||
public function run() | ||
{ | ||
$baz = 'bat'; | ||
$foo = array('bar' => 'baz'); | ||
|
||
echo ${$foo['bar']}; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...Variable/WrapVariableVariableNameInCurlyBracesRector/Fixture/with_array_dim_fetch.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector\Fixture; | ||
|
||
final class WithArrayDimFetch | ||
{ | ||
public function run() | ||
{ | ||
$baz = 'bat'; | ||
$foo = array('bar' => 'baz'); | ||
|
||
echo $$foo['bar']; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector\Fixture; | ||
|
||
final class WithArrayDimFetch | ||
{ | ||
public function run() | ||
{ | ||
$baz = 'bat'; | ||
$foo = array('bar' => 'baz'); | ||
|
||
echo ${$foo['bar']}; | ||
} | ||
} | ||
|
||
?> |
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