DEV-3165 Add Symfony 7 support#341
Open
kiloumap wants to merge 5 commits into
Open
Conversation
added 3 commits
June 17, 2026 16:28
- All 27 packages + root + monorepo-builder.php: symfony/* ^6.4.0 -> ^6.4 || ^7.0 - symfony/flex ^1.16 -> ^2.10 (SF7.4 http-kernel conflicts flex <2.10) - sonata-project/form-extensions ^1.13 -> ^2.0 (1.x caps event-dispatcher at ^6.2, blocking SF7; 2.x supports SF6.4+7) - Resolves cleanly on Symfony 7.4.13 (sonata-admin auto-bumps to 4.43.0) Refs DEV-4044.
- JWTLoginTrait::loginUser(): add $tokenAttributes param to match SF7 KernelBrowser::loginUser() signature (optional param, compatible with 6.4) - OpenApi::validate(): enableAnnotationMapping() -> enableAttributeMapping() (removed in SF7; enableAttributeMapping exists since 6.4) Refs DEV-4044.
- AppKernelTest event_dispatcher/message_handler snapshots: SF7 adds ResetMemoryUsageListener, IsCsrfTokenValidAttributeListener, messenger message signing (sign=1), Notifier DesktopMessage handler - GenerateDocumentationCommandTest: SF7 Console adds --silent global option - phpstan-baseline regenerated on SF7 (47->268 lines; mostly phpstan-symfony Config-generics noise + non-empty-string getUserIdentifier tightening) - gitignore flex-2 auto-generated config/reference.php Refs DEV-4044.
added 2 commits
June 19, 2026 09:51
- Declare symfony/var-exporter in console/application/sonata-import-bundle/ sonata-extra-bundle: Doctrine ORM 3 lazy proxies (LazyGhost) need it when the package is tested in isolation (After Split Testing); the monorepo had it transitively so the full suite passed. - Apply php-cs-fixer no_whitespace_in_empty_array (newer php-cs-fixer pulled by the SF7 resolution) to 4 pre-existing test files. Refs DEV-4044.
… from cs-fixer - AbstainRoleHierarchyVoter, CanShowMessageVoter, DefaultCanVoter, PreventDeleteVoter: add ?Vote $vote = null to vote() to match SF7.3+ VoterInterface::vote() (the new 4th arg); pass through to parent in AbstainRoleHierarchyVoter. Fatal 'must be compatible' surfaced in the isolated After-Split test for sonata-extra-bundle. - php-cs-fixer: notPath the flex-generated config/reference.php. Refs DEV-4044.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the
draw/*packages compatible with Symfony 7 (alongside 6.4) so downstream apps (pnp-api) can complete the Symfony 7.4 LTS upgrade. Implements DEV-3165 (unblocks pnp-api DEV-3995), story DEV-4044.Changes
Dependency constraints
monorepo-builder.php:symfony/* ^6.4.0→^6.4 || ^7.0.symfony/flex^1.16→^2.10— SF 7.4http-kerneldeclares a conflict withflex <2.10.sonata-project/form-extensions^1.13→^2.0— 1.x pinsevent-dispatcher ^4.4||^5.4||^6.2(caps Symfony at 6.x); 2.x supports SF 6.4 and 7. This was the actual blocker preventing the whole tree from resolving on 7.x.Code fixes (SF7 removals)
JWTLoginTrait::loginUser()— added thearray $tokenAttributes = []parameter to match SF7'sKernelBrowser::loginUser()signature. Optional param ⇒ still compatible with 6.4.OpenApi::validate()—ValidatorBuilder::enableAnnotationMapping()(removed in SF7) →enableAttributeMapping()(available since 6.4).Test fixtures / static analysis
AppKernelTestevent-dispatcher & message-handler snapshots — SF7 legitimately addsResetMemoryUsageListener,IsCsrfTokenValidAttributeListener, messenger message signing (sign=1), and the NotifierDesktopMessagehandler.GenerateDocumentationCommandTestfixture — SF7 Console adds the--silentglobal option.phpstan-baseline.neonregenerated on SF7 (grew 47→268 lines / 66 baselined errors). The additions are predominantly phpstan-symfony Config-generics noise andnon-empty-stringgetUserIdentifier()tightenings in test code — worth a skim, but no runtime impact..gitignore: flex-2 auto-generatedconfig/reference.php.Testing
php-cs-fixerclean on changed files;phpstangreen (with regenerated baseline).fgetcsv()$escape,ReflectionProperty::setValue()single-arg) unrelated to the Symfony bump — left out of scope.Notes
Constraints keep
^6.4for a transition window, but the lock now resolves to 7.4 (composer picks highest), so CI runs on 7.4.