Repository navigation
Conversation
Several 5.0 changes need an entry in the update guide; adding the empty guide first keeps their pull requests from conflicting over its creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getInstance() and the static $instances storage, the name magic property, the $offset/$limit arguments of setQuery(), the $new argument of getQuery() and DatabaseQuery::dump() were announced for removal long ago. Passing the removed arguments now throws instead of being silently ignored, so a forgotten getQuery(true) or setQuery($q, 0, 1) cannot return the wrong query or all rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary of Changes
Removes API that was deprecated in 1.x/2.x and announced for removal (several messages still said "3.0"):
DatabaseDriver::getInstance()andstatic $instancesDatabaseFactory::getDriver()$db->nameviaDatabaseDriver::__get()getName()$offset/$limitarguments ofsetQuery()(driver andDatabaseInterface)QueryInterface::setLimit()$newargument ofgetQuery()(driver andDatabaseInterface)createQuery()DatabaseQuery::dump()PHP silently accepts extra arguments, so a forgotten
setQuery($query, 0, 1)would return every row andgetQuery(true)would return the current query. To avoid that,setQuery()throws anInvalidArgumentExceptionwhen more than one argument is passed, andgetQuery()throws for a truthy argument (getQuery(false)keeps working).The 4.x side (#407) corrects the deprecation messages to say 5.0. When 4.x-dev is merged up, the removed blocks here win over the message changes there.
Testing Instructions
testGetQueryWithArgumentThrowsandtestSetQueryWithOffsetAndLimitThrowsinTests/AbstractDatabaseDriverTestCase.php.setLimit().vendor/bin/phpunitand-c phpunit.sqlite.xml.distpass, as do phpcs and PHPStan. The other driver suites run in CI.Documentation Changes Required
Entry "Removed deprecated API" in
docs/v4-to-v5-update.md.Depends on #410 (creates
docs/v4-to-v5-update.md; this branch is based on it) and relates to #407. Expect a small conflict indocs/v4-to-v5-update.mdwith #411/#412, which also append to it.🤖 Generated with Claude Code