Skip to content

Commit 4248169

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 2c059ee commit 4248169

File tree

6 files changed

+1
-19
lines changed

6 files changed

+1
-19
lines changed

src/Symfony/Component/BrowserKit/Client.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ public function setMaxRedirects($maxRedirects)
9797
public function insulate($insulated = true)
9898
{
9999
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
100-
// @codeCoverageIgnoreStart
101100
throw new \RuntimeException('Unable to isolate requests as the Symfony Process Component is not installed.');
102-
// @codeCoverageIgnoreEnd
103101
}
104102

105103
$this->insulated = (Boolean) $insulated;
@@ -378,9 +376,7 @@ abstract protected function doRequest($request);
378376
*/
379377
protected function getScript($request)
380378
{
381-
// @codeCoverageIgnoreStart
382379
throw new \LogicException('To insulate requests, you need to override the getScript() method.');
383-
// @codeCoverageIgnoreEnd
384380
}
385381

386382
/**

src/Symfony/Component/Console/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;

src/Symfony/Component/Console/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]);

src/Symfony/Component/Console/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
}

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,7 @@ public function filterXPath($xpath)
627627
public function filter($selector)
628628
{
629629
if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) {
630-
// @codeCoverageIgnoreStart
631630
throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector is not installed (you can use filterXPath instead).');
632-
// @codeCoverageIgnoreEnd
633631
}
634632

635633
return $this->filterXPath(CssSelector::toXPath($selector));
@@ -813,11 +811,9 @@ public function getNode($position)
813811
if ($i == $position) {
814812
return $node;
815813
}
816-
// @codeCoverageIgnoreStart
817814
}
818815

819816
return null;
820-
// @codeCoverageIgnoreEnd
821817
}
822818

823819
/**

src/Symfony/Component/Translation/PluralizationRules.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
class PluralizationRules
2020
{
21-
// @codeCoverageIgnoreStart
2221
private static $rules = array();
2322

2423
/**
@@ -212,6 +211,4 @@ public static function set($rule, $locale)
212211

213212
self::$rules[$locale] = $rule;
214213
}
215-
216-
// @codeCoverageIgnoreEnd
217214
}

0 commit comments

Comments
 (0)