Ardem/yii-coding-standard — pull request #13 by gabeguz (2014-12-05 22:08:33+00:00)
Title: Add suppport for file sent on stdin.

There is an issue when calling this ruleset via arc lint that causes it to fail with the following error message:

```Exception
Some linters failed:
- ArcanistPhpcsLinter: CommandException: Command failed with error #1!
COMMAND
'phpcs' '--report=xml' '--standard=Yii'

STDOUT

Warning: file_get_contents(STDIN): failed to open stream: No such file or directory in /Volumes/src/copper/build/coding_standards/Yii/Sniffs/Files/Utf8EncodingSniff.php on line 67

Expected 1 space before "="; 0 found
Expected 1 space after "="; 0 found
Expected 1 space before "="; 0 found
Expected 1 space after "="; 0 found

STDERR
PHP Warning: file_get_contents(STDIN): failed to open stream: No such file or directory in /Volumes/src/copper/build/coding_standards/Yii/Sniffs/Files/Utf8EncodingSniff.php on line 67
```

Basically, arcanist sends the data to phpcs on stdin, and then this rule isn't able to deal with it because it can't open the file STDIN.

This pull request checks to see if the filename is STDIN, and if so, uses php://stdin for the call to file_get_contents()

Also tested with an actual file named STDIN, and the code still works as expected.