Skip to content

Upgrading phpunit/php-code-coverage 11 to 12

Breaking11.0.12 → 12.5.8Breaking3Platform1New5Changed21Fixed18

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • The method that reported whether dead code detection was enabled has been removed, so any code calling it will break.
  • These methods no longer accept the optional list of lines to be used, so callers passing it must stop doing so.
  • If you call these methods to set coverage targets, you must now pass a TargetCollection object rather than a plain array.
  • You can no longer use this package on PHP 8.2 and must upgrade your PHP runtime.
4 items need code or config changes

PHP requirement changed in 12.0.0: >=8.2 → >=8.3.

Breaking3
Removes the CodeCoverage::detectsDeadCode() method.
CodeCoverage::detectsDeadCode()
Removes the optional $linesToBeUsed argument of CodeCoverage::stop() and CodeCoverage::append().
CodeCoverage::stop()CodeCoverage::append()$linesToBeUsed
CodeCoverage::stop() and CodeCoverage::append() now expect a TargetCollection instead of an array to configure code coverage targets.
CodeCoverage::stop()CodeCoverage::append()TargetCollection
Platform1
Drops support for PHP 8.2; this component is no longer supported on that version.