~ancarda/coverage-enforcer

1bb3861140c5034298c699793297d5e00c100cfc — Mark Dain a month ago bb6a35d
CI improvements and fixes

Fix builds to run correctly on PHP 7.3 and ping Packagist to sync on
every push.
M .builds/php7_3.yml => .builds/php7_3.yml +6 -2
@@ 1,8 1,11 @@
---
image: debian/buster

secrets:
 - cde47d09-64da-4651-a62e-bf762c4dec73

sources:
  - https://git.sr.ht/~ancarda/psr7-string-stream
  - https://git.sr.ht/~ancarda/coverage-enforcer

packages:
  - php7.3-cli


@@ 18,7 21,7 @@ packages:
  - unzip

environment:
  DIR: psr7-string-stream
  DIR: coverage-enforcer
  XDEBUG_MODE: coverage

tasks:


@@ 28,3 31,4 @@ tasks:
  - test:        cd $DIR && composer run-script test
  - check-cov:   cd $DIR && composer run-script check-coverage
  - check-tests: cd $DIR && composer run-script check-tests
  - packagist:   cd $DIR && .builds/poke-packagist ancarda coverage-enforcer ~/.packagist-api-token

M .builds/php7_4.yml => .builds/php7_4.yml +2 -2
@@ 2,7 2,7 @@
image: debian/bullseye

sources:
  - https://git.sr.ht/~ancarda/psr7-string-stream
  - https://git.sr.ht/~ancarda/coverage-enforcer

packages:
  - php7.4-cli


@@ 18,7 18,7 @@ packages:
  - unzip

environment:
  DIR: psr7-string-stream
  DIR: coverage-enforcer
  XDEBUG_MODE: coverage

tasks:

M .builds/php8_0.yml => .builds/php8_0.yml +2 -2
@@ 2,7 2,7 @@
image: debian/sid

sources:
  - https://git.sr.ht/~ancarda/psr7-string-stream
  - https://git.sr.ht/~ancarda/coverage-enforcer

packages:
  - php8.0-cli


@@ 22,7 22,7 @@ packages:
  - unzip

environment:
  DIR: psr7-string-stream
  DIR: coverage-enforcer
  XDEBUG_MODE: coverage

tasks:

A .builds/poke-packagist => .builds/poke-packagist +5 -0
@@ 0,0 1,5 @@
#!/bin/sh
curl -X POST \
	-H 'content-type:application/json' \
	"https://packagist.org/api/update-package?username=${1}&apiToken=$(cat $3)" \
	--data "{\"repository\":{\"url\":\"https://packagist.org/packages/${1}/${2}\"}}"

M composer.json => composer.json +6 -2
@@ 4,6 4,9 @@
    "type": "project",
    "license": "MIT",
    "config": {
        "platform": {
            "php": "7.3"
        },
        "sort-packages": true
    },
    "autoload": {


@@ 19,10 22,11 @@
    "require": {
        "php": "^7.3|^8.0",
        "ext-simplexml": "*",
        "symfony/console": "^5.2"
        "symfony/console": "^5.1"
    },
    "require-dev": {
        "infection/infection": "^0.21.4",
        "composer/package-versions-deprecated": "1.11.99.1",
        "infection/infection": "^0.18.2",
        "phpstan/phpstan": "^0.12.82",
        "phpstan/phpstan-phpunit": "^0.12.18",
        "phpstan/phpstan-strict-rules": "^0.12.9",

M composer.lock => composer.lock +88 -143
@@ 4,7 4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "9723294dbb0d13c25eada9c57fa9d3bf",
    "content-hash": "ace1ccc635453ee130487e98f25465a4",
    "packages": [
        {
            "name": "psr/container",


@@ 802,6 802,79 @@
    ],
    "packages-dev": [
        {
            "name": "composer/package-versions-deprecated",
            "version": "1.11.99.1",
            "source": {
                "type": "git",
                "url": "https://github.com/composer/package-versions-deprecated.git",
                "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6",
                "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^1.1.0 || ^2.0",
                "php": "^7 || ^8"
            },
            "replace": {
                "ocramius/package-versions": "1.11.99"
            },
            "require-dev": {
                "composer/composer": "^1.9.3 || ^2.0@dev",
                "ext-zip": "^1.13",
                "phpunit/phpunit": "^6.5 || ^7"
            },
            "type": "composer-plugin",
            "extra": {
                "class": "PackageVersions\\Installer",
                "branch-alias": {
                    "dev-master": "1.x-dev"
                }
            },
            "autoload": {
                "psr-4": {
                    "PackageVersions\\": "src/PackageVersions"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Marco Pivetta",
                    "email": "ocramius@gmail.com"
                },
                {
                    "name": "Jordi Boggiano",
                    "email": "j.boggiano@seld.be"
                }
            ],
            "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
            "support": {
                "issues": "https://github.com/composer/package-versions-deprecated/issues",
                "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1"
            },
            "funding": [
                {
                    "url": "https://packagist.com",
                    "type": "custom"
                },
                {
                    "url": "https://github.com/composer",
                    "type": "github"
                },
                {
                    "url": "https://tidelift.com/funding/github/packagist/composer/composer",
                    "type": "tidelift"
                }
            ],
            "time": "2020-11-11T10:22:58+00:00"
        },
        {
            "name": "composer/xdebug-handler",
            "version": "1.4.6",
            "source": {


@@ 1083,16 1156,16 @@
        },
        {
            "name": "infection/infection",
            "version": "0.21.4",
            "version": "0.18.2",
            "source": {
                "type": "git",
                "url": "https://github.com/infection/infection.git",
                "reference": "2ca5fd6ef8d291bf6577936bd8e25b5a2cf0cc09"
                "reference": "05685f8e97ec2d42455fdaad6984446d5af2f67e"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/infection/infection/zipball/2ca5fd6ef8d291bf6577936bd8e25b5a2cf0cc09",
                "reference": "2ca5fd6ef8d291bf6577936bd8e25b5a2cf0cc09",
                "url": "https://api.github.com/repos/infection/infection/zipball/05685f8e97ec2d42455fdaad6984446d5af2f67e",
                "reference": "05685f8e97ec2d42455fdaad6984446d5af2f67e",
                "shasum": ""
            },
            "require": {


@@ 1104,12 1177,11 @@
                "infection/extension-installer": "^0.1.0",
                "infection/include-interceptor": "^0.2.4",
                "justinrainbow/json-schema": "^5.2",
                "nikic/php-parser": "^4.10.3",
                "nikic/php-parser": "^4.10.2",
                "ocramius/package-versions": "^1.2 || ^2.0",
                "ondram/ci-detector": "^3.3.0",
                "php": "^7.4 || ^8.0",
                "sanmai/later": "^0.1.1",
                "sanmai/pipeline": "^5.1",
                "php": "^7.3 || ^8.0",
                "sanmai/pipeline": "^3.1 || ^5.0",
                "sebastian/diff": "^3.0.2 || ^4.0",
                "seld/jsonlint": "^1.7",
                "symfony/console": "^3.4.29 || ^4.1.19 || ^5.0",


@@ 1125,16 1197,16 @@
                "symfony/console": "=4.1.5"
            },
            "require-dev": {
                "composer/package-versions-deprecated": "^1.2 || ^2.0",
                "ext-simplexml": "*",
                "helmich/phpunit-json-assert": "^3.0",
                "phpspec/prophecy-phpunit": "^2.0",
                "phpstan/extension-installer": "^1.0",
                "phpstan/phpstan": "^0.12.8",
                "phpstan/phpstan-phpunit": "^0.12.6",
                "phpstan/phpstan-strict-rules": "^0.12.5",
                "phpstan/phpstan-webmozart-assert": "^0.12.2",
                "phpunit/phpunit": "^9.3.11",
                "symfony/phpunit-bridge": "^4.4.18 || ^5.1.10",
                "symfony/phpunit-bridge": "^4.4.14 || ^5.1.6",
                "symfony/yaml": "^5.0",
                "thecodingmachine/phpstan-safe-rule": "^1.0"
            },


@@ 1192,19 1264,9 @@
            ],
            "support": {
                "issues": "https://github.com/infection/infection/issues",
                "source": "https://github.com/infection/infection/tree/0.21.4"
                "source": "https://github.com/infection/infection/tree/0.18.2"
            },
            "funding": [
                {
                    "url": "https://github.com/infection",
                    "type": "github"
                },
                {
                    "url": "https://opencollective.com/infection",
                    "type": "open_collective"
                }
            ],
            "time": "2021-03-03T09:02:15+00:00"
            "time": "2020-10-21T20:25:38+00:00"
        },
        {
            "name": "justinrainbow/json-schema",


@@ 1391,68 1453,6 @@
            "time": "2020-12-20T10:01:03+00:00"
        },
        {
            "name": "ocramius/package-versions",
            "version": "2.1.0",
            "source": {
                "type": "git",
                "url": "https://github.com/Ocramius/PackageVersions.git",
                "reference": "a7e35c34bc166a5684a1e2f13da7b1d6a821349d"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a7e35c34bc166a5684a1e2f13da7b1d6a821349d",
                "reference": "a7e35c34bc166a5684a1e2f13da7b1d6a821349d",
                "shasum": ""
            },
            "require": {
                "composer-runtime-api": "^2.0.0",
                "php": "^7.4.7 || ~8.0.0"
            },
            "replace": {
                "composer/package-versions-deprecated": "*"
            },
            "require-dev": {
                "composer/composer": "^2.0.0@dev",
                "doctrine/coding-standard": "^8.1.0",
                "ext-zip": "^1.15.0",
                "infection/infection": "dev-master#8d6c4d6b15ec58d3190a78b7774a5d604ec1075a",
                "phpunit/phpunit": "~9.3.11",
                "vimeo/psalm": "^4.0.1"
            },
            "type": "library",
            "autoload": {
                "psr-4": {
                    "PackageVersions\\": "src/PackageVersions"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Marco Pivetta",
                    "email": "ocramius@gmail.com"
                }
            ],
            "description": "Provides efficient querying for installed package versions (no runtime IO)",
            "support": {
                "issues": "https://github.com/Ocramius/PackageVersions/issues",
                "source": "https://github.com/Ocramius/PackageVersions/tree/2.1.0"
            },
            "funding": [
                {
                    "url": "https://github.com/Ocramius",
                    "type": "github"
                },
                {
                    "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions",
                    "type": "tidelift"
                }
            ],
            "time": "2020-10-21T13:48:04+00:00"
        },
        {
            "name": "ondram/ci-detector",
            "version": "3.5.1",
            "source": {


@@ 2498,64 2498,6 @@
            "time": "2020-03-23T09:12:05+00:00"
        },
        {
            "name": "sanmai/later",
            "version": "0.1.2",
            "source": {
                "type": "git",
                "url": "https://github.com/sanmai/later.git",
                "reference": "9b659fecef2030193fd02402955bc39629d5606f"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f",
                "reference": "9b659fecef2030193fd02402955bc39629d5606f",
                "shasum": ""
            },
            "require": {
                "php": ">=7.1"
            },
            "require-dev": {
                "friendsofphp/php-cs-fixer": "^2.13",
                "infection/infection": ">=0.10.5",
                "phan/phan": ">=2",
                "php-coveralls/php-coveralls": "^2.0",
                "phpstan/phpstan": ">=0.10",
                "phpunit/phpunit": ">=7.4",
                "vimeo/psalm": ">=2"
            },
            "type": "library",
            "autoload": {
                "psr-4": {
                    "Later\\": "src/"
                },
                "files": [
                    "src/functions.php"
                ]
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "Apache-2.0"
            ],
            "authors": [
                {
                    "name": "Alexey Kopytko",
                    "email": "alexey@kopytko.com"
                }
            ],
            "description": "Later: deferred wrapper object",
            "support": {
                "issues": "https://github.com/sanmai/later/issues",
                "source": "https://github.com/sanmai/later/tree/0.1.2"
            },
            "funding": [
                {
                    "url": "https://github.com/sanmai",
                    "type": "github"
                }
            ],
            "time": "2021-01-02T10:26:44+00:00"
        },
        {
            "name": "sanmai/pipeline",
            "version": "v5.1.0",
            "source": {


@@ 4196,5 4138,8 @@
        "ext-simplexml": "*"
    },
    "platform-dev": [],
    "platform-overrides": {
        "php": "7.3"
    },
    "plugin-api-version": "2.0.0"
}

M tests/AuditorTest.php => tests/AuditorTest.php +7 -1
@@ 43,7 43,13 @@ final class AudiorTest extends TestCase
        $filePath = __DIR__ . '/files/parse-failure.xml';

        $this->expectException(RuntimeException::class);
        $this->expectExceptionMessage('Parse Error: EndTag: \'</\' not found');

        // LibXML error messages are different on PHP 7.3.x.
        if (PHP_VERSION_ID < 70400) {
            $this->expectExceptionMessage('Parse Error: Premature end of data');
        } else {
            $this->expectExceptionMessage('Parse Error: EndTag: \'</\' not found');
        }

        Auditor::assertStatementsCovered($filePath, 100);
    }