-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up mix HTML+PHP first stmt check (#3285)
* Clean up mix HTML+PHP first stmt check * more failing fixture * more failing fixture * Fix * use newStmts count * [ci-review] Rector Rectify * Fix * Fix * first and last node must be different * Fix * more fixture * [ci-review] Rector Rectify * phpstan * rename method * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
410e939
commit 4b6a559
Showing
3 changed files
with
77 additions
and
18 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...CodeQuality/Rector/For_/ForRepeatedCountToOwnVariableRector/Fixture/mix_html_php2.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 | ||
echo 'test'; | ||
?> | ||
<div> | ||
<?php | ||
for ($i = 5; $i <= count($items); $i++) { | ||
echo $items[$i]; | ||
} | ||
?> | ||
</div> | ||
----- | ||
<?php | ||
|
||
echo 'test'; | ||
?> | ||
<div> | ||
<?php | ||
$itemsCount = count($items); | ||
for ($i = 5; $i <= $itemsCount; $i++) { | ||
echo $items[$i]; | ||
} | ||
?> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
...CodeQuality/Rector/For_/ForRepeatedCountToOwnVariableRector/Fixture/mix_html_php3.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,28 @@ | ||
<?php | ||
echo 'test'; | ||
?> | ||
<div> | ||
<?php | ||
for ($i = 5; $i <= count($items); $i++) { | ||
echo $items[$i]; | ||
} | ||
?> | ||
</div> | ||
<?php | ||
echo 'test 2'; | ||
?> | ||
----- | ||
<?php | ||
|
||
echo 'test'; | ||
?> | ||
<div> | ||
<?php | ||
$itemsCount = count($items); | ||
for ($i = 5; $i <= $itemsCount; $i++) { | ||
echo $items[$i]; | ||
} | ||
?> | ||
</div> | ||
<?php | ||
echo 'test 2'; |
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