Skip to content

Raise minimum PHP to 8.3 and migrate QA tooling to phpdb-qa-tools (Mago, Infection, Codecov) - #11

Open
simon-mundy wants to merge 3 commits into
php-db:0.1.xfrom
simon-mundy:qa-tools-migration-php83
Open

Raise minimum PHP to 8.3 and migrate QA tooling to phpdb-qa-tools (Mago, Infection, Codecov)#11
simon-mundy wants to merge 3 commits into
php-db:0.1.xfrom
simon-mundy:qa-tools-migration-php83

Conversation

@simon-mundy

@simon-mundy simon-mundy commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Implements #10: raises the minimum PHP to 8.3 and replaces laminas-coding-standard and PHPStan with the shared php-db/phpdb-qa-tools toolchain, with Infection and Codecov wired in.

  • require.php~8.3.0 || ~8.4.0 || ~8.5.0, config.platform.php8.3.99, CI matrix ["8.3", "8.4", "8.5"].
  • php-db/phpdb-qa-tools: 0.1.x-dev and infection/infection: ^0.34.1 added to require-dev, infection/extension-installer allow-listed.
  • mago.toml — extends the shared config, php-version = "8.3.0", source paths src and test.
  • infection.json5.diststaticAnalysisTool: "mago", Stryker badge on \d+\.\d+\.x branches.
  • codecov.yml — project and patch status at target: auto, threshold: 0%.
  • Scripts follow the shared convention: cs-check/cs-fix (mago format + lint), static-analysis (mago analyze), mutation-test (infection).
  • Removed phpcs.xml.dist, phpstan.neon.dist, phpstan-baseline.neon, stubs/ (PHPStan-only), .laminas-ci.json and coveralls.yml, plus the phpcs and phpstan dev dependencies.
  • .github/workflows/continuous-integration.yml becomes a caller of the shared reusable workflow at @0.1.x, with the Postgres service inputs, run-integration: true, Codecov and Infection enabled and coverage-php-version: "8.5". test-env-json overrides TESTS_PHPDB_PGSQL_HOSTNAME to 127.0.0.1 so phpunit.xml.dist keeps its Compose default for local dev.

Two commits: the migration, then the baselines.

Baselines

Mago is stricter than the PHPStan level 5 baseline it replaces, so the 354 existing findings are recorded in lint-baseline.toml (123) and analyzer-baseline.toml (231), as php-db/phpdb already does. New findings in new code still fail. Working them down is tracked in #13.

Test plan

mago format --check, lint, analyze and guard all clean. Unit suite green. Integration suite not run locally — no Docker daemon here, so it runs for the first time under the new workflow.

Notes

composer.lock was updated with composer update php-db/phpdb-qa-tools infection/infection rather than wholesale. Current php-db/phpdb 0.6.x-dev adds ResultInterface::getQueryResult(), which Pgsql\Result does not implement, so a full update fatals before any test runs — see #12. The latest legs of the matrix will hit this.

INFECTION_DASHBOARD_API_KEY needs generating for this repo before mutation-test can report.

Replaces laminas-coding-standard and PHPStan with mago via
php-db/phpdb-qa-tools 0.1.x-dev, and turns on the shared workflow's codecov
and mutation-test jobs, which need secrets: inherit and a
coverage-php-version to nominate the canonical matrix leg — without the
latter no clover artifact is produced and both jobs break.

Infection 0.33+ requires PHP ^8.3, so 8.2 goes: the php constraint,
config.platform.php, mago.toml and the CI matrix all move with it.

mago.toml extends the shared config. infection.json5.dist sets
staticAnalysisTool: "mago" and badges the versioned release branches.
codecov.yml reports project and patch status at target: auto. Composer
scripts follow the shared convention of cs-check/cs-fix, static-analysis
and mutation-test.

phpcs.xml.dist, phpstan.neon.dist, phpstan-baseline.neon, stubs/
(PHPStan-only), .laminas-ci.json and coveralls.yml go, with the phpcs and
phpstan dev dependencies. test-env-json points TESTS_PHPDB_PGSQL_HOSTNAME
at 127.0.0.1 for CI, since the jobs are not containerised, leaving
phpunit.xml.dist on the Compose default for local dev. Schema seeding stays
with the ListenerExtension bootstrap.

composer.lock moves for the new dev dependencies only. Current
php-db/phpdb 0.6.x-dev adds ResultInterface::getQueryResult(), which
Pgsql\Result does not implement, so a wholesale update fatals before any
test runs.

Also applies mago formatting and the safe lint fixes across src and test.
Mago is stricter than the PHPStan level 5 baseline it replaces, so the 123
linter and 231 analyzer findings already present are recorded in
lint-baseline.toml and analyzer-baseline.toml, matching the rest of the org.
format --check, lint, analyze and guard all pass, and new findings in new
code still fail.
@simon-mundy
simon-mundy force-pushed the qa-tools-migration-php83 branch from f57b5ae to 02eb97a Compare August 24, 2026 05:25
AdapterInterface declares no __construct, so CoversMethod named a target
that cannot exist and PHPUnit raised "is not a valid target for code
coverage" once per test. With failOnWarning="true" that failed the coverage
leg of the matrix, the only leg where coverage metadata is validated, which
is why this surfaced with the qa-tools workflow and not before.
@simon-mundy
simon-mundy requested a review from tyrsson August 24, 2026 05:47
@simon-mundy simon-mundy self-assigned this Aug 24, 2026
@simon-mundy simon-mundy added this to the 0.1.0 milestone Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant