- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
I have a file test.php
with the following content
<?php $out=array_map(function($test) { if($test) return 1; else return 2; }, $input); $out=array_map(function($test) { if($test) return 1; else return 2; }, $input); // this line is as the above but with a trailing comment
when I run vendor/bin/phpcbf test.php
, I get the following fixed file
<?php $out=array_map( function ($test) { if($test) { return 1; } else { return 2; } }, $input ); $out=array_map( function ($test) { if($test) { return 1; else { return 2; } }, $input ); // this line is as the above but with a trailing comment }
Notice the if
brace did not close before the else
, and that the array_map
parentheses close too early.
I'm using "squizlabs/php_codesniffer": "^2.7"
in my composer.json
file