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

Yoast / PHPUnit-Polyfills / 9922992689 / 15
96%
3.x: 98%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: 3.x
Ran 13 Jul 2024 09:31PM UTC
Files 41
Run time 3s
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

13 Jul 2024 09:30PM UTC coverage: 61.29%. Remained the same
9922992689.15

push

github

jrfnl
CI/QA: add phpstan

PHPStan is a good addition to the QA toolkit and with improvements PHPStan has made over the years is now a viable tool for us to use (previously it would give way too many false positives).

This commit:
* Adds a separate job to the `cs` workflow in GH Actions.
    Notes:
    - I've chosen **not** to add PHPStan to the Composer dependencies for two reasons:
        1. It doesn't allow for installation on PHP < 7.2, which would break/block the `composer install` for the test runs.
        2. It would potentially add dependencies which could conflict/cause problems for our test runs due to those defining token constants too.
            _Note: this does not seem to be a problem with the latest versions anymore as the Composer package ships a PHAR file under the hood._
    - We could potentially use [Phive](https://phar.io/) to still have a setup which can be used locally, but just running locally from a PHPStan PHAR file should work just fine.
    - For CI, PHPStan will be installed as a PHAR file by `setup-php` now.
        This does carry a risk _if_ PHPStan would make breaking changes or if a new release adds rules for the levels being scanned as, in that case, builds could unexpectedly start failing.
        The version `setup-php` installs could be hard-coded to the current release `1.11.7`, but that adds an additional maintenance burden of having to keep updating the version as PHPStan releases pretty often.
        So, for now, I've elected to run the risk of random failures. If and when those start happening, we can re-evaluate.
    - The PHP version for the CI run is set to PHP 7.4 to prevent PHPStan throwing some errors/notices related to the outdated PHPUnit version(s) being used.
* Adds a configuration file for PHPStan.
    Notes:
    - The codebase is "clean", so setting scan level to 9 (highest possible).
    - Two files need to be excluded as they contain (non-)issues which PHPStan cannot work around and which prevent... (continued)

418 of 682 relevant lines covered (61.29%)

4.43 hits per line

Source Files on job php-7.2-phpunit-phar-6 - 9922992689.15
  • Tree
  • List 41
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 9922992689
  • 418ef1de on github
  • Prev Job for on JRF/1.x/add-phpstan (#9922984320.17)
  • Next Job for on JRF/1.x/add-phpstan (#9923010789.17)
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

© 2025 Coveralls, Inc