All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.1 - 2024-10-09
- Adds
phpstan-baseline.neon
for PHPStan. - Adds new GitHub workflow to generate the Phar and uploads an artifact:
- On release - if it is a release, it also signs the Phar and uploads the
.asc
for verification - For pull requests
- On a schedule
- On release - if it is a release, it also signs the Phar and uploads the
- Adds
phpstan/extension-installer
withcomposer.json
config updated to allow plugins for PHPStan.
- Updated coding standards with PHP-CS-Fixer, applied fixes.
- Updated
backward-compatibility.md
- Updated
CONTRIBUTING.md
with more guidelines/information. - Updated
.gitattributes
- Updates:
phpstan
to the non-dev1.12.0
phpstan/phpstan-phpunit
to the non-dev1.4.0
phpstan/phpstan-strict-rules
to the non-dev1.6.0
- The
box
configuration for generating the Phar has been updated.- The Phar will now be scoped to
Esi\CoverageCheckPhar
. - The Phar now will be gz compressed, which adds
ext-zlib
as a requirement to run it.
- The Phar will now be scoped to
2.0.0 - 2024-04-21
- A new
Esi\CoverageCheck\Application
class which extendsSymfony\Component\Console\Application
.- Overrides
getDefaultInputDefinition()
andconfigureIO()
to clean up help output.
- Overrides
- New
Utils
class.- Adds a new function
isPossiblyClover()
, which attempts to ensure the provided file is a PHPUnit generated clover file.
- Adds a new function
- New
Style\CoverageCheckStyle
which extendsSymfony\Console\Style\SymfonyStyle
to format console output. - New shortcut for the
--only-percentage
option for the Console. You can use-O
instead. - 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_FILES
and the following functions:CoverageCheck::processByFile()
CoverageCheckCommand::getFileTable()
CoverageCheckCommand::getResultOutput()
- This adds a new constant
- Minimum PHP version increased to 8.2.
- Symfony minimum ^7.0
- PHPUnit minimum ^11.0
- The use of
coverage:check
when 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 90
CoverageCheck::loadMetrics
can now throw aRuntimeException
iffile_get_contents
fails for whatever reason or if the newisPossiblyClover
returns false.- With the addition of the new
--show-files
option and related additions, theCoverageCheck::loadMetrics()
now has one parameter:$xpath
.
- With the addition of the new
- Class const
XPATH_METRICS
now hasprotected
visibility. - Class const
APPLICATION_NAME
andVERSION
moved fromCoverageCheck
toApplication
.- Subsequently,
Application
now also overrides the parentSymfony\Component\Console\Application
constructor and passes these values to the parent class.
- Subsequently,
- Changed output message formats for
CoverageCheck::nonConsoleCall
and 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.
CoverageCheckCommand
updated to use theSymfony\Console\Attribute\AsCommand
attribute, as using the static properties is deprecated as ofSymfony\Console
6.1.
- 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.
- The new
--show-files
option is not yet supported inCoverageCheck::nonConsoleCall()
. - Cleanup, and add to, documentation throughout.
1.0.0 - 2024-03-26
This initial version is forked from rregeer/phpunit-coverage-check by Richard Regeer. This is the CHANGELOG for changes in comparison to the original library.
backward-compatibility.md
for the Backward Compatibility Promise.CHANGELOG.md
to keep track of changes.SECURITY.md
for the security policy.- Testing and analysis workflows based on GitHub actions.
- Unit testing via PHPUnit.
box.json
that is used for generating Phar files for the library.- Phar file will be added to each new release.
- Dev dependencies for PHPStan (and strict rules, bleeding edge, Symfony plugins) and PHPCS-Fixer.
- Dependency scanning via Renovate.
Symfony\Console
is now a runtime dependency.- Library is now namespace'd to
Esi\CoverageCheck
.
- Reformatted composer.json, added more information/sections.
- Minimum PHP version bumped to 8.1.
coverage-check
(instead of coverage-check.php) in the root directory, which is the bin file.- Updated
README.md
with more information, and changes to the usage of this library. - This library is now a
Symfony\Console
application.
coverage-check.php
,bin/coverage-check
, andtest/run
removed.