Skip to content

Commit

Permalink
Merge pull request #2 from xBazilio/master
Browse files Browse the repository at this point in the history
stream checking moved after files checking
  • Loading branch information
mipxtx committed Apr 19, 2016
2 parents e7330a7 + 287b354 commit a30f611
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions CodeSniffer/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,16 +758,6 @@ public function processLongArgument($arg, $pos)
*/
public function processUnknownArgument($arg, $pos)
{
// Check if anything was passed via STDIN. If so,
// ignore all passed files.
$read = array(STDIN);
$write = array();
$except = array();
$result = stream_select($read, $write, $except, 0);
if ($result === 1) {
return;
}

// We don't know about any additional switches; just files.
if ($arg{0} === '-') {
if ($this->dieOnUnknownArg === false) {
Expand All @@ -781,6 +771,15 @@ public function processUnknownArgument($arg, $pos)

$file = PHP_CodeSniffer::realpath($arg);
if (file_exists($file) === false) {
// Check if anything was passed via STDIN.
$read = array(STDIN);
$write = array();
$except = array();
$result = stream_select($read, $write, $except, 0);
if ($result === 1) {
return;
}

if ($this->dieOnUnknownArg === false) {
return;
}
Expand Down

0 comments on commit a30f611

Please sign in to comment.