Skip to content

1.1.0

Latest

Choose a tag to compare

@janedbal janedbal released this 17 Jul 12:30
Immutable release. Only release title and notes can be modified.
b969686

New features:

  • Executable line excluders: exclude lines you don't want to enforce coverage for (#67)
    • register via Config::addExecutableLineExcluder()
    • prepared IgnoreThrowNewExceptionLineExcluder allows excluding e.g. all throw new LogicException(...) lines
    • honored by both check and patch-coverage commands
    • excluded lines are rendered with gray background in check output
// coverage-guard.php
use ShipMonk\CoverageGuard\Config;
use ShipMonk\CoverageGuard\Excluder\IgnoreThrowNewExceptionLineExcluder;

$config = new Config();
$config->addExecutableLineExcluder(new IgnoreThrowNewExceptionLineExcluder([
    LogicException::class,
]));

return $config;

Fixes:

  • Methods with nothing to cover are no longer reported as uncovered; CodeBlock::getCoveragePercentage() returns 100% when there are no executable lines (#67)
    • Previously, it wrongly reported 0%
  • Make coverage path mapping insensitive to trailing slashes (#82)