2.0.0
[2.0.0] - 2024-04-21
Added
- A new
Esi\CoverageCheck\Applicationclass which extendsSymfony\Component\Console\Application.- Overrides
getDefaultInputDefinition()andconfigureIO()to clean up help output.
- Overrides
- New
Utilsclass.- Adds a new function
isPossiblyClover(), which attempts to ensure the provided file is a PHPUnit generated clover file.
- Adds a new function
- New
Style\CoverageCheckStylewhich extendsSymfony\Console\Style\SymfonyStyleto format console output. - New shortcut for the
--only-percentageoption for the Console. You can use-Oinstead. - New option
--show-files(shortcut-F), to break down metrics by file, and output the results via a table.- This adds a new constant
CoverageCheck::XPATH_FILESand the following functions:CoverageCheck::processByFile()CoverageCheckCommand::getFileTable()CoverageCheckCommand::getResultOutput()
- This adds a new constant
Changed
- Minimum PHP version increased to 8.2.
- Symfony minimum ^7.0
- PHPUnit minimum ^11.0
- The use of
coverage:checkwhen calling the Phar or the bin file is no longer needed.
# before
$ php vendor/bin/coverage-check coverage:check /path/to/clover.xml 90
# after
$ php vendor/bin/coverage-check /path/to/clover.xml 90CoverageCheck::loadMetricscan now throw aRuntimeExceptioniffile_get_contentsfails for whatever reason or if the newisPossiblyCloverreturns false.- With the addition of the new
--show-filesoption and related additions, theCoverageCheck::loadMetrics()now has one parameter:$xpath.
- With the addition of the new
- Class const
XPATH_METRICSnow hasprotectedvisibility. - Class const
APPLICATION_NAMEandVERSIONmoved fromCoverageChecktoApplication.- Subsequently,
Applicationnow also overrides the parentSymfony\Component\Console\Applicationconstructor and passes these values to the parent class.
- Subsequently,
- Changed output message formats for
CoverageCheck::nonConsoleCalland the Console to match more closely:- Old messages:
- Insufficient data for calculation. Please add more code.
- Total code coverage is %s which is below the accepted %d%%
- Total code coverage is %s - OK!
- New messages:
- [ERROR] Insufficient data for calculation. Please add more code.
- [ERROR] Total code coverage is %s which is below the accepted %d%%
- [OK] Total code coverage is %s
- Old messages:
- Unit tests updated accordingly.
Fixed
CoverageCheckCommandupdated to use theSymfony\Console\Attribute\AsCommandattribute, as using the static properties is deprecated as ofSymfony\Console6.1.
Removed
- Removed dev-dependency for
phpstan\phpstan-symfony. Seemed to be a bit overkill to require a dependency for something I was able to solve with a couple extra lines, and was running into an issue where it seemed to suppress other issues from being reported. - Removed
tests/console-application.php, since it was a requirement for phpstan-symfony.
TODO
- The new
--show-filesoption is not yet supported inCoverageCheck::nonConsoleCall(). - Cleanup, and add to, documentation throughout.
GitHub PR's
- Update dependency phpunit/phpunit to v10.5.16 by @renovate in #3
- Lock file maintenance by @renovate in #4
- Lock file maintenance by @renovate in #5
- Lock file maintenance by @renovate in #6
- Update dependency phpunit/phpunit to v10.5.17 by @renovate in #8
- Lock file maintenance by @renovate in #7
- Lock file maintenance by @renovate in #9
- Update tests.yml by @ericsizemore in #11
- Lock file maintenance by @renovate in #10
- Update dependency phpstan/phpstan-symfony to v1.3.11 by @renovate in #12
- Lock file maintenance by @renovate in #13
- Update dependency phpunit/phpunit to v10.5.18 by @renovate in #14
- Update dependency phpstan/phpstan-symfony to v1.3.12 by @renovate in #15
- Lock file maintenance by @renovate in #16
- Lock file maintenance by @renovate in #17
- Lock file maintenance by @renovate in #19
- Update dependency phpunit/phpunit to v10.5.19 by @renovate in #20
- Prepare 2.0.0 by @ericsizemore in #22
New Contributors
- @renovate made their first contribution in #3
- @ericsizemore made their first contribution in #11
Full Changelog: 1.0.0...2.0.0