-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dx] Add HTMLAverseRectorInterface to teach rules to skip HTML + PHP …
…mix that would go wrong (#6445) * skip html + php mix * [dx] Add HTMLAverseRectorInterface
- Loading branch information
1 parent
c7dfbe7
commit e562253
Showing
7 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...sts/CodingStyle/Rector/Stmt/NewlineAfterStatementRector/Fixture/skip_html_php_mix.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\Stmt\NewlineAfterStatementRector\Fixture; | ||
|
||
if (mt_rand(0, 1)) { ?> | ||
<div> | ||
<h1>Hi</h1> | ||
</div> | ||
|
||
<?php } else { ?> | ||
<div> | ||
<h1>Bye</h1> | ||
</div> | ||
|
||
<?php } ?> | ||
|
||
End of file |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Contract\Rector; | ||
|
||
/** | ||
* Rector rule with this marker interface will skip all files | ||
* with any HTML node. This is practical to avoid malformed PHP+HTML files | ||
*/ | ||
interface HTMLAverseRectorInterface | ||
{ | ||
} |
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