• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHP_CodeSniffer / 7469576538
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: feature/fixer-conflict/PSR12.Functions.ReturnTypeDeclaration
DEFAULT BRANCH: master
Ran 10 Jan 2024 02:32AM UTC
Jobs 3
Files 257
Run time 19s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Jan 2024 02:31AM UTC coverage: 64.51% (+0.008%) from 64.502%
7469576538

push

github

jrfnl
GH Actions: warm PHPUnit cache on PHPUnit 9.3+

As of PHPUnit 9.3, PHPUnit started using PHP-Parser as a basis to calculate code coverage. PHP Parser also polyfills tokens and that can interfere with the sniffs, but only in code coverage runs.

In PHPUnit 9.3.4 a new feature was added to warm the code cache ahead of running tests recording code coverage. Using that feature should prevent the token interference.

So far, I've not seen problems with this for this codebase, but better safe than sorry, so I'm going to enable cache warming now anyway.

Notes regarding cache-warming:
* The `--coverage-cache` and `--warm-coverage-cache` options are available since PHPUnit 9.3.4 and if these are used on older PHPUnit versions, PHPUnit will error out with an "unrecognized CLI argument" error.
* In other words: these options can only be used with PHPUnit 9.3+, which is why the PHPUnit version is checked and remembered and subsequently used in the conditions.
* Also: running PHPUnit with the `--warm-coverage-cache` option _does not run the tests_. It literally only warms the cache, which is why this is implemented as a separate step in the workflow.
* The cache directory can be configured in the `phpunit.xml[.dist]` file, but only when using the PHPUnit 9.3+ `coverage` XML tag.
    As the PHPUnit config used needs to stay cross-version compatible with older PHPUnit versions, the CLI option is used for now.

Refs:
* https://github.com/sebastianbergmann/php-code-coverage/issues/798#issuecomment-678922065
* https://github.com/sebastianbergmann/phpunit/compare/9.3.3...9.3.4

Also note that PHP-Parser 5.0 was released a couple of days ago and when used for code coverage runs on PHP 8.0 (as used for the 4.0 branch), this causes problems.

When I merge this commit up to 4.0, I will adjust the GH Actions script for the 4.0 branch to use PHP 8.1 instead of PHP 8.0 to avoid this issue.

The issue has been reported upstream: https://github.com/sebastianbergmann/php-code-co... (continued)

15254 of 23646 relevant lines covered (64.51%)

6.05 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-7.2-custom-ini-false - 7469576538.1 10 Jan 2024 02:32AM UTC 257
60.54
GitHub Action Run
2 php-8.3-custom-ini-false - 7469576538.2 10 Jan 2024 02:32AM UTC 257
63.64
GitHub Action Run
3 php-8.1-custom-ini-true - 7469576538.3 10 Jan 2024 02:32AM UTC 257
63.6
GitHub Action Run
Source Files on build 7469576538
  • Tree
  • List 257
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #7469576538
  • 249f20b8 on github
  • Prev Build on 4.0 (#7430747567)
  • Next Build on 4.0 (#7475985802)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc