Skip to content

Move to Symfony 5 and add PHP 8 support - #23

Merged
rick-lam merged 6 commits into
mainfrom
feat/symfony-5
May 28, 2026
Merged

rick-lam merged 6 commits into
mainfrom
feat/symfony-5

Conversation

@rick-lam

@rick-lam rick-lam commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves sprout to symfony/console + symfony/yaml ^5, adopts the tagged Symfony-5-compatible releases of the graze libraries, and adds PHP 8 support (CI now runs 7.4 through 8.5).

Changes

Dependencies

  • symfony/console + symfony/yaml → ^5 (pulls the Symfony stack up to 5.4).
  • graze/parallel-process → ^1.0 (v1.0.1) — Symfony 5 support; requires symfony/process ^5.
  • graze/console-diff-renderer → ^1.1 (v1.1.1).
  • graze/config-validation → ^1.0 (0.2 capped at PHP 7, blocking PHP 8 resolution).
  • respect/validation → ^2.2 (required by config-validation v1).
  • phpunit/phpunit → ^9, mockery/mockery → ^1.6 (PHP 8 mock support).
  • php constraint widened to ^7.4 || ^8.0.

parallel-process API adoption (BC vs the 0.7 sprout previously locked)

  • Pool → PriorityPool (setMaxSimultaneous / max-simultaneous behaviour moved to PriorityPool).
  • Graze\ParallelProcess\Table → Graze\ParallelProcess\Display\Table.
  • Replace the Symfony-5-removed Process::setCommandLine() / string constructor with Process::fromShellCommandline() in the chop/seed/dump runners (+ matching unit-test expectations).

PHPUnit 9 migration

  • Migrate phpunit.xml.dist to the PHPUnit 9 schema (<coverage><include> replaces <filter><whitelist>); drop the unused integration suite (PHPUnit 9.6 errors on the missing directory); pin error_reporting to exclude deprecations.
  • Replace removed @expectedException annotations with expectException() calls.
  • Return bool from mocked PDOStatement::execute() (PHP 8 enforces the return type).
  • Make implicitly-nullable params explicit (?Type) for PHP 8.4+ compatibility.
  • Ignore PHPUnit 9 .phpunit.result.cache.

CI

  • Matrix expanded to PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5. The lowest-dependency variant runs on 7.4 only (older tooling such as phpcs 3.3 cannot run on PHP 8).

Verification

  • 48 unit tests pass on every matrix entry, PHP 7.4 through 8.5 (101 assertions); phpcs + markdown lint green.
  • Previously verified end-to-end on MySQL 8.4 / Symfony 5.4: chop ✓, seed ✓ (250 rows), dump ✓ as the least-privilege user.

🤖 Generated with Claude Code

Requires Symfony-5 releases of graze/parallel-process (>=0.8.2) and
graze/console-diff-renderer (>=0.6.3); composer.lock and final CI
verification are pending those tags.

- composer.json: symfony/console + symfony/yaml -> ^5; bump the graze
  deps to their Symfony-5 lines.
- Adopt the parallel-process 0.8 API: Pool -> PriorityPool (the
  max-simultaneous behaviour moved there) and Table -> Display\Table.
- Replace the Symfony-5-removed Process::setCommandLine()/string ctor
  with Process::fromShellCommandline() in the chop/seed/dump runners
  (+ matching unit test expectations).

Verified end-to-end on MySQL 8.4 with Symfony 5.4 via composer path
repositories to the local libs: chop, seed (250 rows) and dump all
succeed; 48 unit tests + phpcs pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Base automatically changed from chore/upgrade-php74-mysql84 to main May 27, 2026 15:29
rick-lam and others added 2 commits May 28, 2026 20:19
- graze/parallel-process ^0.8 -> ^1.0, graze/console-diff-renderer ^0.6 -> ^1.1
  (pulls Symfony stack up to 5.4 to satisfy symfony/process ^5)
- phpunit/phpunit ^8.5 -> ^9, mockery/mockery ^1.3 -> ^1.6 (PHP 8 mock support)
- Migrate phpunit.xml.dist to the PHPUnit 9 schema (coverage/include) and pin
  error_reporting to exclude deprecations (target runtime is PHP 7.4)
- Replace removed @ExpectedException annotations with expectException() calls
- Return bool from mocked PDOStatement::execute() (PHP 8 enforces the type)
- Make implicitly-nullable params explicit (?Type) for PHP 8.4+ compatibility
- Ignore PHPUnit 9 .phpunit.result.cache

Unit suite green on PHP 7.4.26 and PHP 8.5.6 (48 tests, 101 assertions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PHPUnit 9.6 errors out (exit 2) when a configured testsuite directory is
missing, breaking bare `vendor/bin/phpunit` runs in CI. There are no
integration tests, so remove the suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam changed the title WIP: Move to Symfony 5 Move to Symfony 5 May 28, 2026
rick-lam and others added 3 commits May 28, 2026 20:32
Widen the php constraint to ^7.4 || ^8.0 and add the PHP 8.x line to the
CI matrix. The lowest-dependency variant stays on 7.4 only, since older
tooling (e.g. phpcs 3.3) cannot run on PHP 8.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
graze/config-validation 0.2 caps at PHP 7, blocking dependency resolution
on the new PHP 8 CI runners. v1 requires respect/validation ^2.2, so bump
that too (the validator rules sprout uses are unchanged in v2; both each()
calls already use the single-argument form).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verified locally; the ^8.0 constraint already covers it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam changed the title Move to Symfony 5 Move to Symfony 5 and add PHP 8 support May 28, 2026
@rick-lam
rick-lam marked this pull request as ready for review May 28, 2026 20:25
Copilot AI review requested due to automatic review settings May 28, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates sprout’s dependency stack to Symfony 5.x while widening runtime compatibility to PHP 7.4 and PHP 8.x, including necessary code and test adaptations for upstream API changes (Symfony Process + graze/parallel-process) and PHPUnit 9.

Changes:

  • Upgrade dependencies to Symfony Console/Yaml ^5, update Graze libraries, and widen php constraint to ^7.4 || ^8.0 (with updated lockfile).
  • Adopt graze/parallel-process v1 API (PriorityPool, Display\Table) and update MySQL runner process creation to Process::fromShellCommandline().
  • Migrate test suite to PHPUnit 9 conventions (exception expectations, coverage config) and expand CI matrix to PHP 7.4–8.5.

Reviewed changes

Copilot reviewed 21 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Command/SeedCommand.php Switches to PriorityPool and new display Table for parallel-process v1 compatibility.
src/Command/DumpCommand.php Switches to PriorityPool and new display Table for parallel-process v1 compatibility.
src/Command/ChopCommand.php Switches to PriorityPool and new display Table for parallel-process v1 compatibility.
src/Db/Mysql/MysqlTableSeeder.php Uses Process::fromShellCommandline() for Symfony Process v5 compatibility.
src/Db/Mysql/MysqlTableDumper.php Uses Process::fromShellCommandline() for Symfony Process v5 compatibility.
src/Db/Mysql/MysqlTableChopper.php Uses Process::fromShellCommandline() for Symfony Process v5 compatibility.
src/Parser/SchemaParser.php Makes nullable parameter explicit for PHP 8.4+ compatibility.
src/Parser/FileTablePopulator.php Makes nullable parameter explicit for PHP 8.4+ compatibility.
src/Db/DbTablePopulator.php Makes nullable parameters explicit for PHP 8.4+ compatibility.
src/Config/Config.php Makes nullable parameter explicit for PHP 8.4+ compatibility.
tests/unit/** Updates PHPUnit exception assertions and adjusts mocks for Symfony Process + PDO return-type enforcement.
phpunit.xml.dist Updates to PHPUnit 9 schema and modern coverage configuration.
.github/workflows/ci.yml Expands CI matrix to PHP 7.4–8.5 and scopes prefer-lowest to 7.4.
composer.json Bumps Symfony + Graze dependencies and widens PHP constraint to include PHP 8.
composer.lock Lockfile updated for new dependency set and platform constraints.
.gitignore Ignores PHPUnit 9 result cache file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rick-lam
rick-lam merged commit 454047b into main May 28, 2026
11 checks passed
@rick-lam
rick-lam deleted the feat/symfony-5 branch May 28, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants