Repository navigation
Add support of Doctrine DBAL 4 and Symfony 8 - #7
Merged
Merged
Conversation
The package could not be installed alongside doctrine/doctrine-bundle 3.x, which requires DBAL 4, nor on a Symfony 8 application. No source change was needed for DBAL 4: AbstractDriverMiddleware, AbstractConnectionMiddleware, Driver::connect(), Connection::query(), getNativeConnection() and DriverException::getSQLState() all kept their signatures. Only the constraints were in the way. doctrine/migrations moves to ^3.6, the first release that accepts DBAL 4, while still allowing DBAL 3. PHPStan goes to 2.x, which drops the checkMissingIterableValueType option; the two array parameters it was hiding are now documented instead. The CI matrix gains PHP 8.3, 8.4 and 8.5. Symfony 8 needs PHP 8.4, so without those rows the new support would never be exercised. The existing --prefer-lowest row keeps DBAL 3 covered. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
ndousson
approved these changes
Aug 11, 2026
|
LGTM too, let's wait @B-Galati review. Note: Could be great to drop support for old Symfony and PHP version (not in this PR, but as a potential clean up task), don't know what you think about BG :) |
Collaborator
|
Hi guys! thanks for the ping. Fully agree with you:
Let's do it later 👍 |
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.
Why
The package cannot currently be installed next to
doctrine/doctrine-bundle3.x, which requires DBAL 4, nor on a Symfony 8 application:doctrine/dbal^3.7symfony/string^6.4 || ^7.0We hit this on a new internal service that starts on PHP 8.5 / Symfony 8.1, where
safe-migrationsis the migration base class we want from day one.What changed
No source change was needed for DBAL 4.
AbstractDriverMiddleware,AbstractConnectionMiddleware,Driver::connect(),Connection::query(),getNativeConnection()andDriverException::getSQLState()all kept their signatures. Only the constraints were in the way.doctrine/dbal→^3.7 || ^4.0symfony/string→^6.4 || ^7.0 || ^8.0doctrine/migrations→^3.6, the first release that accepts DBAL 4, still allowing DBAL 3^2.1. It drops thecheckMissingIterableValueTypeoption, so the two array parameters that option was hiding are documented instead — same@param mixed[]asAbstractMigration::addSql()upstream.^10.4.2 || ^11.0, so the suite runs on recent PHP. Capped at 11 on purpose: PHPUnit 12 removes the@before/@afterannotations used inMigrationTest, and converting those belongs in its own pull request.RetryLockTimeoutDriver, which a current php-cs-fixer wants. Included only somake php-cs-fixer-checkstays green on this branch.CI
The matrix gains PHP 8.3, 8.4 and 8.5. Symfony 8 requires PHP 8.4, so without those rows the new support would never actually be exercised. The existing
--prefer-lowestrow keeps DBAL 3 covered, and every other row now resolves to DBAL 4 — so both majors are tested.Static analysis moves from PHP 8.2 to 8.4 for the same reason.
Verified locally
On PHP 8.5.9 with DBAL 4.4.4, doctrine/migrations 3.9.7 and symfony/string 8.1.2, the four steps of
make tests:composer validate --strict— validvendor/bin/phpstan analyse(level 9) — no errorsvendor/bin/php-cs-fixer fix --dry-run— no changesvendor/bin/phpunit— 26 tests, 30 assertions, all passing🤖 Generated with Claude Code