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.
This commit is contained in:
parent
2c059ee52c
commit
4248169e07
@ -97,9 +97,7 @@ abstract class Client
|
|||||||
public function insulate($insulated = true)
|
public function insulate($insulated = true)
|
||||||
{
|
{
|
||||||
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
|
if ($insulated && !class_exists('Symfony\\Component\\Process\\Process')) {
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
throw new \RuntimeException('Unable to isolate requests as the Symfony Process Component is not installed.');
|
throw new \RuntimeException('Unable to isolate requests as the Symfony Process Component is not installed.');
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->insulated = (Boolean) $insulated;
|
$this->insulated = (Boolean) $insulated;
|
||||||
@ -378,9 +376,7 @@ abstract class Client
|
|||||||
*/
|
*/
|
||||||
protected function getScript($request)
|
protected function getScript($request)
|
||||||
{
|
{
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
throw new \LogicException('To insulate requests, you need to override the getScript() method.');
|
throw new \LogicException('To insulate requests, you need to override the getScript() method.');
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,9 +145,8 @@ class Application
|
|||||||
if ($exitCode > 255) {
|
if ($exitCode > 255) {
|
||||||
$exitCode = 255;
|
$exitCode = 255;
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
exit($exitCode);
|
exit($exitCode);
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $exitCode;
|
return $exitCode;
|
||||||
|
@ -72,9 +72,7 @@ class StringInput extends ArgvInput
|
|||||||
$tokens[] = stripcslashes($match[1]);
|
$tokens[] = stripcslashes($match[1]);
|
||||||
} else {
|
} else {
|
||||||
// should never happen
|
// should never happen
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
|
throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cursor += strlen($match[0]);
|
$cursor += strlen($match[0]);
|
||||||
|
@ -75,10 +75,8 @@ class StreamOutput extends Output
|
|||||||
protected function doWrite($message, $newline)
|
protected function doWrite($message, $newline)
|
||||||
{
|
{
|
||||||
if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
|
if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
// should never happen
|
// should never happen
|
||||||
throw new \RuntimeException('Unable to write output.');
|
throw new \RuntimeException('Unable to write output.');
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush($this->stream);
|
fflush($this->stream);
|
||||||
@ -96,12 +94,10 @@ class StreamOutput extends Output
|
|||||||
*/
|
*/
|
||||||
protected function hasColorSupport()
|
protected function hasColorSupport()
|
||||||
{
|
{
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
if (DIRECTORY_SEPARATOR == '\\') {
|
if (DIRECTORY_SEPARATOR == '\\') {
|
||||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
||||||
}
|
}
|
||||||
|
|
||||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,9 +627,7 @@ class Crawler extends \SplObjectStorage
|
|||||||
public function filter($selector)
|
public function filter($selector)
|
||||||
{
|
{
|
||||||
if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) {
|
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).');
|
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));
|
return $this->filterXPath(CssSelector::toXPath($selector));
|
||||||
@ -813,11 +811,9 @@ class Crawler extends \SplObjectStorage
|
|||||||
if ($i == $position) {
|
if ($i == $position) {
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,6 @@ namespace Symfony\Component\Translation;
|
|||||||
*/
|
*/
|
||||||
class PluralizationRules
|
class PluralizationRules
|
||||||
{
|
{
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
private static $rules = array();
|
private static $rules = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -212,6 +211,4 @@ class PluralizationRules
|
|||||||
|
|
||||||
self::$rules[$locale] = $rule;
|
self::$rules[$locale] = $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user