minor #9931 Removed all codeCoverageIgnore annotations from the code (stof)
This PR was merged into the 2.5-dev branch.
Discussion
----------
Removed all codeCoverageIgnore annotations from the code
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
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 IMO.
Thus, some places using them were actually testable (and tested) code.
Commits
-------
4248169
Removed all codeCoverageIgnore annotations from the code
This commit is contained in:
commit
60c2140e7a
@ -97,9 +97,7 @@ abstract class Client
|
||||
public function insulate($insulated = true)
|
||||
{
|
||||
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \RuntimeException('Unable to isolate requests as the Symfony Process Component is not installed.');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
$this->insulated = (Boolean) $insulated;
|
||||
@ -378,9 +376,7 @@ abstract class Client
|
||||
*/
|
||||
protected function getScript($request)
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \LogicException('To insulate requests, you need to override the getScript() method.');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,9 +145,8 @@ class Application
|
||||
if ($exitCode > 255) {
|
||||
$exitCode = 255;
|
||||
}
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
exit($exitCode);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
return $exitCode;
|
||||
|
@ -72,9 +72,7 @@ class StringInput extends ArgvInput
|
||||
$tokens[] = stripcslashes($match[1]);
|
||||
} else {
|
||||
// should never happen
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
$cursor += strlen($match[0]);
|
||||
|
@ -75,10 +75,8 @@ class StreamOutput extends Output
|
||||
protected function doWrite($message, $newline)
|
||||
{
|
||||
if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
|
||||
// @codeCoverageIgnoreStart
|
||||
// should never happen
|
||||
throw new \RuntimeException('Unable to write output.');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
fflush($this->stream);
|
||||
@ -96,12 +94,10 @@ class StreamOutput extends Output
|
||||
*/
|
||||
protected function hasColorSupport()
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
if (DIRECTORY_SEPARATOR == '\\') {
|
||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
||||
}
|
||||
|
||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
@ -627,9 +627,7 @@ class Crawler extends \SplObjectStorage
|
||||
public function filter($selector)
|
||||
{
|
||||
if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector is not installed (you can use filterXPath instead).');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
return $this->filterXPath(CssSelector::toXPath($selector));
|
||||
@ -813,11 +811,9 @@ class Crawler extends \SplObjectStorage
|
||||
if ($i == $position) {
|
||||
return $node;
|
||||
}
|
||||
// @codeCoverageIgnoreStart
|
||||
}
|
||||
|
||||
return null;
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,6 @@ namespace Symfony\Component\Translation;
|
||||
*/
|
||||
class PluralizationRules
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
private static $rules = array();
|
||||
|
||||
/**
|
||||
@ -212,6 +211,4 @@ class PluralizationRules
|
||||
|
||||
self::$rules[$locale] = $rule;
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
Reference in New Issue
Block a user