- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Lets have following code in UTF-8 file test.php
:
rand(0, 1) ? 'ěščřžýáí' : NULL;
And following ruleset:
<?xml version="1.0"?> <ruleset> <rule ref="Squiz.ControlStructures.InlineIfDeclaration"> <exclude name="Squiz.ControlStructures.InlineIfDeclaration.NoBrackets"/> </rule> </ruleset>
It will produce:
$ vendor/bin/phpcs --standard=standards.xml --encoding=utf-8 -sp test.php E FILE: D:\codesniffer-bug\test.php ---------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------- 3 | ERROR | Inline shorthand IF statement requires 1 space before ELSE; | | -7 found | | (Squiz.ControlStructures.InlineIfDeclaration.SpacingBeforeElse) ---------------------------------------------------------------------- Time: 14ms; Memory: 2.25Mb
My observations: the condition must be some php function and the string must contain some UTF-8 chars.