Skip to content

Symfony 5 support (drop > 4.4) - #33

Merged
rick-lam merged 2 commits into
masterfrom
feat/symfony-5-support
May 27, 2026
Merged

Symfony 5 support (drop > 4.4)#33
rick-lam merged 2 commits into
masterfrom
feat/symfony-5-support

Conversation

@rick-lam

@rick-lamrick-lam commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the library to Symfony 5 only on PHP 7.4, and migrates the test suite to PHPUnit 8 (bumped on master in #32).

  • symfony/process & symfony/event-dispatcher: ^2.8 | ^3.2 | ^4.0^5 (Symfony 4.4 support dropped).
  • php: → ^7.4; Composer platform.php pinned to 7.4.
  • Event-dispatcher modernised for Symfony 5 (removed Symfony\Component\EventDispatcher\Event, swapped dispatch() argument order):
    • RunEvent / PriorityChangedEvent extend Symfony\Contracts\EventDispatcher\Event.
    • EventDispatcherTrait dispatches as dispatch($event, $name).
  • PHPUnit 8 migration (required — phpunit 8 fatals on an untyped setUp()):
    • setUp(): void across the unit tests.
    • assertInternalType('float', …)assertIsFloat(…).
  • symfony/console (dev): ^4 | ^5. graze/console-diff-renderer has no Symfony 5 release yet, so it still resolves to console 4.x for the Table/Lines tests — this is a dev/optional dependency and does not affect the library's Symfony 5 runtime support.
  • composer.lock regenerated for the new constraints.

Verification

PHP 7.4 + Symfony 5.4 (process 5.4.51 / event-dispatcher 5.4.45) + PHPUnit 8.5.52:

  • 131 tests pass (phpunit exit 0; remaining output is deprecation warnings only — assertArraySubset / @expectedException, both removed in PHPUnit 9, left as a follow-up).
  • phpcs clean.
  • composer update reports no security advisories.

GitHub Actions CI is added separately in #34 (Travis → GHA); once that lands it validates this matrix on every PR.

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings May 27, 2026 10:53

CopilotAI 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

This PR updates graze/parallel-process to support Symfony 5 (while retaining Symfony 4.4 compatibility) by modernizing event-dispatcher usage and tightening Composer platform requirements to a Symfony-5-compatible PHP baseline.

Changes:

  • Update event classes/tests to extend/use Symfony\Contracts\EventDispatcher\Event (Symfony 5 compatible).
  • Update EventDispatcherTrait to use the Symfony 5+ dispatch($event, $name) argument order.
  • Update Composer constraints for PHP and Symfony components (symfony/process, symfony/event-dispatcher) and pin the dev resolution platform to PHP 7.4.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
tests/unit/Event/EventDispatcherTest.phpSwitch test Event base class import to Symfony Contracts.
tests/src/EventDispatcherFake.phpSwitch fake dispatcher Event base class import to Symfony Contracts.
src/Event/RunEvent.phpSwitch event base class to Symfony\Contracts\EventDispatcher\Event.
src/Event/PriorityChangedEvent.phpSwitch event base class to Symfony\Contracts\EventDispatcher\Event.
src/Event/EventDispatcherTrait.phpUpdate dispatch call signature to Symfony 5+ ordering and update Event import.
composer.jsonRaise PHP requirement, update Symfony package constraints, and set Composer platform PHP to 7.4.

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

Comment threadcomposer.json Outdated
rick-lamand others added 2 commits May 27, 2026 13:08
Allow symfony/process and symfony/event-dispatcher ^4.4 | ^5 and
modernise the event-dispatcher usage for Symfony 5, which removed
Symfony\Component\EventDispatcher\Event and swapped the dispatch()
argument order:
- Events extend Symfony\Contracts\EventDispatcher\Event.
- EventDispatcherTrait dispatches as dispatch($event, $name).
Also raise the PHP floor to ^7.2 (Symfony 4.4/5 minimum) and pin the
resolution platform to 7.4.
Verified on PHP 7.4 with Symfony 5.4: 131 unit tests pass, phpcs clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- symfony/process & symfony/event-dispatcher: ^4.4 | ^5 -> ^5 (Symfony 5 only)
- php: raise floor to ^7.4; pin Composer platform to 7.4
- symfony/console (dev): ^4 | ^5; graze/console-diff-renderer has no Symfony 5
release yet, so it resolves to console 4.x for the Table/Lines tests
- PHPUnit 8 migration: setUp(): void, assertInternalType('float') -> assertIsFloat
- regenerate composer.lock
Validated on PHP 7.4: 131 tests pass, phpcs clean, no Composer advisories.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam
rick-lamforce-pushed the feat/symfony-5-support branch from e6f6c13 to 1298b98CompareMay 27, 2026 12:12
@rick-lamrick-lam changed the title Add Symfony 5 supportSymfony 5 support (drop Symfony 4.4), PHP 7.4, PHPUnit 8May 27, 2026
@rick-lamrick-lam changed the title Symfony 5 support (drop Symfony 4.4), PHP 7.4, PHPUnit 8Symfony 5 support (drop Symfony 4.4)May 27, 2026
@rick-lamrick-lam changed the title Symfony 5 support (drop Symfony 4.4)Symfony 5 support (drop > 4.4)May 27, 2026
@rick-lam
rick-lam merged commit 8598142 into masterMay 27, 2026
@rick-lam
rick-lam deleted the feat/symfony-5-support branch May 28, 2026 18:01
Sign up for freeto 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

@rick-lam