sebastianbergmann / php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
BSD 3-Clause "New" or "Revised" License
8.82k stars 374 forks source link

Fix: Adjust `COMPOSER_ROOT_VERSION` and branch alias #1040

Closed localheinz closed 4 months ago

localheinz commented 4 months ago

This pull request

Related to #1038.

localheinz commented 4 months ago

Hmm.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.93%. Comparing base (9ed46b6) to head (08ec02a). Report is 5 commits behind head on 9.2.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 9.2 #1040 +/- ## ============================================ - Coverage 83.95% 83.93% -0.03% Complexity 1197 1197 ============================================ Files 61 59 -2 Lines 4276 4264 -12 ============================================ - Hits 3590 3579 -11 + Misses 686 685 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

localheinz commented 4 months ago

@sebastianbergmann

Running

<?php

declare(strict_types=1);

use Composer\Semver;

require_once  __DIR__ . '/../vendor/autoload.php';

$versions = [
    '9.2-dev',
    '9.2.x-dev',
    '9.3-dev',
    '9.3.x-dev',
];

$constraint = '^9.2.13';

var_dump(array_combine(
    $versions,
    array_map(static function (string $version) use ($constraint): string {
        return sprintf(
            '%s %s',
            Semver\Semver::satisfies($version, $constraint) ? 'satisfies' : 'does not satisfy',
            $constraint
        );
    }, $versions)
));

yields

array(4) {
  ["9.2-dev"]=>
  string(24) "does not satisfy ^9.2.13"
  ["9.2.x-dev"]=>
  string(17) "satisfies ^9.2.13"
  ["9.3-dev"]=>
  string(17) "satisfies ^9.2.13"
  ["9.3.x-dev"]=>
  string(17) "satisfies ^9.2.13"
}

Does that make sense?

sebastianbergmann commented 4 months ago

Does that make sense?

No, but it seems to fix the build :-) Thanks!