Skip to content

Add Symfony 8 support#581

Merged
pierredup merged 7 commits into
Payum:masterfrom
Rafikooo:feature/symfony-8-support
Feb 10, 2026
Merged

Add Symfony 8 support#581
pierredup merged 7 commits into
Payum:masterfrom
Rafikooo:feature/symfony-8-support

Conversation

@Rafikooo
Copy link
Copy Markdown
Contributor

@Rafikooo Rafikooo commented Feb 5, 2026

Summary

This PR adds support for Symfony 8 to PayumBundle.

Changes

Breaking changes:

  • Dropped PHP 7.4 support (now requires PHP 8.0+)
  • Dropped Symfony 4.4 support (now requires SF 5.4+)
  • Dropped Symfony 6.0 from CI matrix (non-LTS, has PHPUnit compatibility issues)

Symfony 8 compatibility:

  • Converted all XML service configs to PHP (SF8 removed XML config support)
  • Converted all XML routing files to YAML (SF8 removed XML routing support)
  • Updated CreditCardDate constraint constructor for SF8 named parameter syntax
  • Fixed NotifyController to use $request->attributes->get() instead of deprecated $request->get()
  • Fixed HttpRequestVerifier to use explicit parameter bag access

Test fixes:

  • Updated PHPUnit mock class name assertions (Mock_MockObject_)
  • Fixed NotifyControllerTest to use route attributes instead of query params
  • Updated phpunit.xml.dist for PHPUnit 10+ compatibility
  • Excluded abstract test class from test suite

CI Matrix

Now tests against:

  • PHP 8.0-8.5
  • Symfony 5.4, 6.4, 7.0, 8.0

@TheMilek TheMilek mentioned this pull request Feb 6, 2026
@Rafikooo Rafikooo force-pushed the feature/symfony-8-support branch from 36208b0 to 625edfb Compare February 6, 2026 08:55
- Require PHP ^8.0
- Require Symfony ^5.4 || ^6.0 || ^7.0 || ^8.0
- Remove symfony/polyfill-php80 dependency
Symfony 8 removed XmlFileLoader, requiring PHP-based service
configuration. This converts all XML configs to PHP format using
ContainerBuilder API.
Symfony 8 removed XML routing support. This converts all routing
configuration from XML to YAML format.
- Replace deprecated Request::get() with explicit parameter bag access
- Add nullable return type to FormType::getParent() methods
- Update CreditCardDate constraint for SF8 named parameter syntax
- Add config_sf8.yml for SF8-specific session configuration
- Fix mock class name assertions (Mock_ -> MockObject_)
- Update NotifyControllerTest to use request attributes
- Exclude abstract test class from phpunit.xml.dist
- Remove deprecated PHPUnit config attributes
- Add PHP 8.4, 8.5 with Symfony 7.0 and 8.0
- Remove PHP 7.4 and Symfony 4.4 combinations
- Remove Symfony 6.0 (non-LTS, has PHPUnit compatibility issues)
- Use --prefer-source for payum/core test classes
Comment thread Controller/NotifyController.php Outdated
Comment thread DependencyInjection/Factory/Storage/DoctrineStorageFactory.php Outdated
Comment thread DependencyInjection/Factory/Storage/FilesystemStorageFactory.php Outdated
Comment thread DependencyInjection/Factory/Storage/Propel1StorageFactory.php Outdated
Comment thread DependencyInjection/Factory/Storage/Propel2StorageFactory.php Outdated
Comment thread DependencyInjection/PayumExtension.php Outdated
Comment thread Security/HttpRequestVerifier.php Outdated
- Use getString() instead of get() for typed parameter access
- Use dirname(__DIR__, N) instead of __DIR__.'/..' concatenation
@pierredup pierredup self-assigned this Feb 10, 2026
@pierredup pierredup added this to the next milestone Feb 10, 2026
@pierredup pierredup merged commit 0b82867 into Payum:master Feb 10, 2026
@Chris53897
Copy link
Copy Markdown
Contributor

Thanks all

@jakubtobiasz
Copy link
Copy Markdown

Hello @pierredup, I see this PR was released as part of the 2.7.0 update. Unfortunately, the

  • Converted all XML service configs to PHP (SF8 removed XML config support)
  • Converted all XML routing files to YAML (SF8 removed XML routing support)

is a massive BC break. Even Sylius wasn't ready for this change, as the latest branch is still importing the .xml files. For me, we should keep the .xml files next to the new ones, until a new major is released.

@pierredup
Copy link
Copy Markdown
Member

@jakubtobiasz Thanks for pointing this out. a BC layer has been added in #584 and released in 2.7.1

@jakubtobiasz
Copy link
Copy Markdown

Thanks for fixing this quickly 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants