-
-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php71] Skip AssignArrayToStringRector on assign var not defined befo…
…re (#5985)
- Loading branch information
1 parent
cee8046
commit 45f6570
Showing
5 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...sts/Php71/Rector/Assign/AssignArrayToStringRector/Fixture/skip_cast_undefined_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,16 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php71\Rector\Assign\AssignArrayToStringRector\Fixture; | ||
|
||
class SkipCastUndefinedVar | ||
{ | ||
public function fun() | ||
{ | ||
$array[] = 'foo'; | ||
$array[] = 'bar'; | ||
|
||
return $array; | ||
} | ||
} | ||
|
||
?> |
18 changes: 18 additions & 0 deletions
18
...ts/Php71/Rector/Assign/AssignArrayToStringRector/Fixture/skip_cast_undefined_var2.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,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php71\Rector\Assign\AssignArrayToStringRector\Fixture; | ||
|
||
class SkipCastUndefinedVar2 | ||
{ | ||
private $array; | ||
|
||
public function fun() | ||
{ | ||
$array[] = 'foo'; | ||
$array[] = 'bar'; | ||
|
||
return $array; | ||
} | ||
} | ||
|
||
?> |
20 changes: 20 additions & 0 deletions
20
...ts/Php71/Rector/Assign/AssignArrayToStringRector/Fixture/skip_cast_undefined_var3.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\Php71\Rector\Assign\AssignArrayToStringRector\Fixture; | ||
|
||
class SkipCastUndefinedVar3 | ||
{ | ||
public function fun() | ||
{ | ||
$array = []; | ||
|
||
function () { | ||
$array[] = 'foo'; | ||
$array[] = 'bar'; | ||
|
||
return $array; | ||
}; | ||
} | ||
} | ||
|
||
?> |
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