Skip to content

Commit 90cd91b

Browse files
committed
Removed all codeCoverageIgnore annotations from the code
These annotations are artificially bumping the code coverage. Unreached code should be reported in the coverage report, even if we cannot reach 100% coverage for some safeguards. Thus, some places using them were actually testable (and tested) code.
1 parent a66ead5 commit 90cd91b

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

Application.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null
145145
if ($exitCode > 255) {
146146
$exitCode = 255;
147147
}
148-
// @codeCoverageIgnoreStart
148+
149149
exit($exitCode);
150-
// @codeCoverageIgnoreEnd
151150
}
152151

153152
return $exitCode;

Input/StringInput.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ private function tokenize($input)
7272
$tokens[] = stripcslashes($match[1]);
7373
} else {
7474
// should never happen
75-
// @codeCoverageIgnoreStart
7675
throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
77-
// @codeCoverageIgnoreEnd
7876
}
7977

8078
$cursor += strlen($match[0]);

Output/StreamOutput.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ public function getStream()
7575
protected function doWrite($message, $newline)
7676
{
7777
if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
78-
// @codeCoverageIgnoreStart
7978
// should never happen
8079
throw new \RuntimeException('Unable to write output.');
81-
// @codeCoverageIgnoreEnd
8280
}
8381

8482
fflush($this->stream);
@@ -96,12 +94,10 @@ protected function doWrite($message, $newline)
9694
*/
9795
protected function hasColorSupport()
9896
{
99-
// @codeCoverageIgnoreStart
10097
if (DIRECTORY_SEPARATOR == '\\') {
10198
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
10299
}
103100

104101
return function_exists('posix_isatty') && @posix_isatty($this->stream);
105-
// @codeCoverageIgnoreEnd
106102
}
107103
}

0 commit comments

Comments
 (0)