Closed
Description
phpcbf corrupts code by Generic.ControlStructures.InlineControlStructure.NotAllowed sniff.
Consider this code:
<?php
if (true) $callable = function () {
return true;
};
phpcbf transforms it to:
<?php
if (true) {
$callable = function () {
return true;
}
};
Which is incorrect - semicolon is placed wrongly.
phpcs.xml is very simple:
<?xml version="1.0"?>
<ruleset name="This project standard">
<description>Standard for this project</description>
<rule ref="PSR2"/>
</ruleset>
Version:
$ phpcbf --version
PHP_CodeSniffer version 3.3.0 (stable) by Squiz (http://www.squiz.net)