Please summarise the discussion in the issue you've referenced as far as it's relevant to Flycheck and elaborate why we need to drop standard input for phpcs. Ideally, try to produce a minimal example where phpcs behaves different as expected with Flycheck.
There are phpcs rules that _depends_ on the file location.
As an example take this excerpt from CakePHP code sniffer (taked from here):
<rule ref="Squiz.NamingConventions.ValidFunctionName">
<exclude-pattern>*/src/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
it tells to phpcs to exclude that rule when the path of the file being checked match the patterns.
So, if you are checking files under src/ (which are almost all in a cakephp project and most other frameworks) and you call phpcs with file path it won't apply that rule, and you'll see less errors.
If you call phpcs with STDIN it can't know where the file is, so it applies _all_ the rules, resulting in an incorrect list of errors.
I hope it to be understandable, my english is really bad.
@choma Other syntax checkers (e.g. rubocop, eslint, etc.) solve this by accepting the name of the file as argument. Is that no option for phpcs?
@choma phpcs 2.6 will provide an option --stdin-path which allows us to set the path, see https://github.com/squizlabs/PHP_CodeSniffer/issues/934#issuecomment-203161356
When phpcs 2.6 is released will use this option to fix this issue.
phpcs 2.6 is out now, I'll update the syntax checker definition soon. Note that this will implicitly drop support for any older phpcs release.
@choma I've updated phpcs accordingly, the issue should be fixed now.
Thanks for reporting it, and for your help with finding a proper solution! 馃憤