I believe a false positive is being matched in tpl.php template files due to the use of alternate code structures, for example:
<?php if (mystatement() == TRUE): ?>
This produces the following warning: "phpcs: There must be a single space before an operator statement."
Is it possible to detect these control structures an not error on these?
Comments
Comment #1
das-peter commentedHmm, I can't reproduce the issue with the latest dev.
A construct like the following passes without any notices / errors:
Could you provide the exact code that produces the error for you?
Comment #2
tancThanks for your quick reply!
A sample of offending code would be:
I'm using this phpcs definition with PHPStorm. I wonder if that is a factor? I'm using the 7.x-1.x branch from git.
Comment #3
tancConfirmed that running drush drupalcs on the tpl file didn't trigger those warnings. So its something in the way PHPStorm is using the files. Any ideas?
Comment #4
das-peter commentedI use it with phpStorm, but not the built in inspection. In the versions I've tested this was a horrible performance slowdown.
So I configured dupalcs as an External Tool - not as convenient as the built-in inspection but still better than nothing.
However, I've no clue why the inspection does something extra :|
Btw. thanks for remembering of the performance problem - I finally created an issue in the phpStorm Issue queue: http://youtrack.jetbrains.com/issue/WI-12097
Comment #5
tancHmm... Thats weird as I don't notice the performance issue, there is a little slow down as the file is again scanned and the warnings added but it hasn't been too slow for me. I am running some serious hardware (latest MBP) including an SSD though.
As for this issue, I'll try digging a little more and report back if I find anything.
Comment #6
klausiReopen if this is still an issue.