Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php71] Skip re-assign as string on AssignArrayToStringRector (#5659)
* [Php71] Skip re-assign as string on AssignArrayToStringRector * fixture * [ci-review] Rector Rectify * [Php71] Skip re-assign as string on AssignArrayToStringRector --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
f5a45a5
commit d754bec
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...s/Php71/Rector/Assign/AssignArrayToStringRector/Fixture/skip_reassigned_as_string.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,21 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php71\Rector\Assign\AssignArrayToStringRector\Fixture; | ||
|
||
final class SkipReAssignedAsString | ||
{ | ||
public function fun($cdate) | ||
{ | ||
if ($cdate) { | ||
$where[] = 'n.sometable <= 1000'; | ||
} | ||
|
||
if (empty($where)) { | ||
$where = ''; | ||
} else { | ||
$where = 'WHERE ' . implode(' AND ', $where); | ||
} | ||
|
||
$sql = 'SELECT something, something FROM table1' . $where; | ||
} | ||
} |
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