Skip to content

Commit 6331251

Browse files
authored
[CodeQuality] Skip in html for ForRepeatedCountToOwnVariableRector (#7981)
* [CodeQuality] Skip in html for ForRepeatedCountToOwnVariableRecto * [CodeQuality] Skip in html for ForRepeatedCountToOwnVariableRecto
1 parent 2166603 commit 6331251

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div>
2+
<?php for ($i = 5; $i <= count($items); $i++) : ?>
3+
<p>Item <?php echo $i; ?></p>
4+
<?php endfor; ?>
5+
</div>

rules/CodeQuality/Rector/For_/ForRepeatedCountToOwnVariableRector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PhpParser\Node\Stmt;
1515
use PhpParser\Node\Stmt\Expression;
1616
use PhpParser\Node\Stmt\For_;
17+
use Rector\Contract\Rector\HTMLAverseRectorInterface;
1718
use Rector\PHPStan\ScopeFetcher;
1819
use Rector\Rector\AbstractRector;
1920
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@@ -22,7 +23,7 @@
2223
/**
2324
* @see \Rector\Tests\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector\ForRepeatedCountToOwnVariableRectorTest
2425
*/
25-
final class ForRepeatedCountToOwnVariableRector extends AbstractRector
26+
final class ForRepeatedCountToOwnVariableRector extends AbstractRector implements HTMLAverseRectorInterface
2627
{
2728
private const string COUNTER_NAME = 'counter';
2829

0 commit comments

Comments
 (0)