diff --git a/src/Files/DummyFile.php b/src/Files/DummyFile.php index 3275bf0920..601430301d 100644 --- a/src/Files/DummyFile.php +++ b/src/Files/DummyFile.php @@ -38,7 +38,7 @@ public function __construct($content, Ruleset $ruleset, Config $config) // This is done by including: phpcs_input_file: [file path] // as the first line of content. $path = 'STDIN'; - if ($content !== null) { + if ($content !== '') { if (substr($content, 0, 17) === 'phpcs_input_file:') { $eolPos = strpos($content, $this->eolChar); $filename = trim(substr($content, 17, ($eolPos - 17))); diff --git a/src/Runner.php b/src/Runner.php index 03238cd59d..253ec91f9f 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -732,7 +732,7 @@ private function processChildProcs($childProcs) if (isset($childOutput) === false) { // The child process died, so the run has failed. - $file = new DummyFile(null, $this->ruleset, $this->config); + $file = new DummyFile('', $this->ruleset, $this->config); $file->setErrorCounts(1, 0, 0, 0); $this->printProgress($file, $totalBatches, $numProcessed); $success = false; @@ -756,7 +756,7 @@ private function processChildProcs($childProcs) } // Fake a processed file so we can print progress output for the batch. - $file = new DummyFile(null, $this->ruleset, $this->config); + $file = new DummyFile('', $this->ruleset, $this->config); $file->setErrorCounts( $childOutput['totalErrors'], $childOutput['totalWarnings'],