Describe the bug
Div end tag removed when reformatting using phpcbf to reformat code to PSR-12 standard
Code sample
// before reformatter
</div> <?php endif; ?>
// after reformatter
<?php endif; ?>
Custom ruleset
<?xml version="1.0"?>
<ruleset name="My Custom Standard">
<description>If you are using a custom ruleset, please enter it here.</description>
<description>Besides the below, have some exclude patterns that shouldn't affect the outcode.</description>
<rule ref="PSR12"/>
<arg name="extensions" value="php" />
</ruleset>
To reproduce
Steps to reproduce the behavior:
- Create a file called
test.php with the code sample above...
- Run
php phpcbf.phar --standard=ruleset.xml test.php -v
- See code reformatted with the end div removed
Expected behavior
Should not remove HTML
Versions (please complete the following information):
- OS: MacOS 11.5.2
- PHP: 8.0.2
- $ php phpcbf.phar --version
PHP_CodeSniffer version 3.6.0 (stable) by Squiz (http://www.squiz.net)
- Standard: PSR12