Closed allanforms closed 3 weeks ago
ForRepeatedCountToOwnVariableRector detected a correction on the following code
</tr> <?php for ($i = 0; $i < count($arrlinks); $i++) { ?> <tr bgcolor="#FFFFFF">
and corrected to this
</tr> $counter = count($arrlinks);<?php for ($i = 0; $i < $counter; $i++) { ?> <tr bgcolor="#FFFFFF">
I thought it would make something like this
</tr> <?php $counter = count($arrlinks); for ($i = 0; $i < $counter; $i++) { ?> <tr bgcolor="#FFFFFF">
or this
</tr> <?php $counter = count($arrlinks); for ($i = 0; $i < $counter; $i++) { ?>
That expected drawback of mix PHP+HTML, you need to verify manually on that, see https://github.com/rectorphp/rector?tab=readme-ov-file#may-cause-unexpected-output-on-file-with-mixed-phphtml-content
Bug Report
ForRepeatedCountToOwnVariableRector detected a correction on the following code
and corrected to this
Expected Behaviour
I thought it would make something like this
or this
or this