Skip to content

Add Symfony event system to HTTP kernel with zero-breaking migration path#1

Draft
Copilot wants to merge 9 commits into
masterfrom
copilot/create-symfony-compliant-repo
Draft

Add Symfony event system to HTTP kernel with zero-breaking migration path#1
Copilot wants to merge 9 commits into
masterfrom
copilot/create-symfony-compliant-repo

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 7, 2026

  • Update package PHP requirement to ^8.2
  • Constrain dev test runner to a PHP 8.2-compatible PHPUnit version
  • Update phpunit.xml.dist to a modern PHPUnit schema/config compatible with the selected PHPUnit
  • Fix PHPUnit compatibility issues in tests (static data providers)
  • Address obvious PHP 8.2/test-run issues surfaced during review
  • Run local validation we can execute and capture the remaining dependency-install blocker

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 6 commits February 7, 2026 21:28
- Created kernel event classes (RequestEvent, ResponseEvent, ExceptionEvent, TerminateEvent, ControllerEvent, FinishRequestEvent)
- Added KernelEvents constants following Symfony conventions
- Integrated event dispatcher trait to kernel
- Updated Kernel::handle() to dispatch events alongside middleware
- Implemented proper exception handling with ExceptionEvent
- Added terminate() lifecycle with TerminateEvent dispatching
- Included example event subscribers for responses and exceptions
- Fixed deprecated MASTER_REQUEST constant usage

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
- Added RequestStack for tracking main/sub requests
- Implemented ControllerResolver and ArgumentResolver (Symfony-compliant)
- Added HasRequestStack and HasControllerResolver traits
- Created comprehensive tests for kernel events
- Updated README with features, usage examples and migration guide
- Added detailed MIGRATION.md for PSR-15 to Symfony events transition
- Integrated request stack into kernel handle() lifecycle

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
- Implemented middleware group registration and management methods
- Added ViewEvent for handling non-Response controller returns
- Created middleware groups helper methods (middlewareGroup, routeMiddleware)
- Added three comprehensive example files demonstrating:
  - Basic kernel usage with event subscribers
  - Middleware groups organization
  - Event-based exception handling patterns
- Enhanced kernel API for better Symfony compatibility

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
…ravel dependencies

- Fixed FinishRequestEvent documentation to clarify it's for request cleanup, not termination
- Removed Laravel/Illuminate-specific middleware references from examples
- Use generic App\Http\Middleware examples instead to avoid confusion

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
- Created CHANGELOG.md documenting all changes and architecture
- Added CONTRIBUTING.md with development guidelines and best practices
- Created SUMMARY.md providing high-level overview of the refactoring
- All documentation follows best practices and is user-friendly
- Covers migration strategy, backward compatibility, and future direction

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
- Created detailed architecture documentation with ASCII diagrams
- Documented request flow, exception flow, and event priority
- Illustrated component interactions and class structure
- Provided visual migration path from middleware to events
- Explained backward compatibility layer design
- Included performance characteristics and design decisions

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
Copilot AI changed the title [WIP] Create new repository following Symfony kernel standards Add Symfony event system to HTTP kernel with zero-breaking migration path Feb 7, 2026
Copilot AI requested a review from gabrielsolomon February 7, 2026 21:41
- Update composer.json constraint from ^1.0 to ^1.0|^2.0
- Request/Traits/PsrBridgeTrait: change all with* return types from
  interface types (MessageInterface/RequestInterface/ServerRequestInterface)
  to static; add PSR-7 v2 parameter type hints (string $version,
  string $name, string|array $value, null|array|object $data, mixed $value);
  remove unused imports
- Response/PsrBridgeTrait: change all with* return types to static;
  add PSR-7 v2 parameter type hints; implement getHeaders(), getHeader(),
  getHeaderLine(), hasHeader() correctly; fix getReasonPhrase() stub;
  remove unused ResponseInterface import

Agent-Logs-Url: https://github.com/bytic/http/sessions/7b3135b6-8ebd-40d1-9405-59b31c4886e2

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
- Raise minimum PHP requirement to ^8.2
- Pin PHPUnit to ^11.5 for PHP 8.2-compatible test runs
- Update phpunit.xml.dist to PHPUnit 11.5 schema and remove deprecated coverage/verbose config
- Make test data providers static and typed for modern PHPUnit
- Update contributing docs to reflect PHP 8.2 baseline

Agent-Logs-Url: https://github.com/bytic/http/sessions/cf388e92-1f06-456e-976e-40ce96a06929

Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
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