Repository navigation
fix: import the phpdb exception marker from its current location - #97
Merged
Merged
Conversation
PhpDb\Sql\Exception\ExceptionInterface no longer exists. Commit 01a9406b in php-db/phpdb made PhpDb\Exception\ExceptionInterface the only marker and removed the Sql namespaced one. The removed interface is not a supertype of the new one, so an import pointing at it leaves analyze with nothing to match: the class cannot be resolved, and every throwable in the hierarchy becomes unhandled because no @throws tag can cover it. Two files referenced it. InitDbCommand aliases it as SqlException, and PhpDbHandler used it directly for the write() docblock. The replacement is a stricter marker, not a looser one. Every exception in the hierarchy now implements PhpDb\Exception\ExceptionInterface, including PhpDb\Sql\Exception\InvalidArgumentException and RuntimeException, which extend their PhpDb\Exception counterparts, and that interface extends Throwable. This is a prerequisite for the lock file maintenance PR, which crosses the removal commit and currently fails analyze for these two imports.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
PhpDb\Sql\Exception\ExceptionInterfaceno longer exists. Commit01a9406binphp-db/phpdb, "Make PhpDb\Exception\ExceptionInterface the only marker, extending Throwable", removed theSqlnamespaced one.This is a prerequisite for #92, which crosses that commit and currently fails
mago analyze:Why the import cannot simply be left alone
The removed interface was not a supertype of the new one. When the import cannot resolve, analyze has no type to match against, so every throwable in the hierarchy becomes unhandled and no
@throwstag can cover it. Theunhandled-thrown-typeerror follows from the missing class, not from a separate defect.Two files, not one
src/Console/InitDbCommand.phpSqlExceptionsrc/Handler/PhpDbHandler.phpwrite()docblockThe second only surfaced after fixing the first, because analyze reports the first failure and the earlier CI log tail showed only the handler.
The replacement is stricter, not looser
PhpDb\Exception\ExceptionInterfaceextendsThrowable, and every exception in the hierarchy implements it. TheSqlnamespaced subclasses extend theirPhpDb\Exceptioncounterparts:so
PhpDb\Sql\Exception\InvalidArgumentExceptionis still covered by a@throws PhpDb\Exception\ExceptionInterfacetag.Verified against the failure, not just the current pin
7d1b659and present at69c8da3, and that01a9406bis not an ancestor of the current pin, which is why2.0.xis green todayphp-db/phpdbto7d1b659and reproduced the CI failure, then confirmed analyze clean with the fixmago analyzeat7d1b659: no issuesGates at the current pin,
phpdb69c8da3:mago format --check: already formattedmago lint: no issuesmago analyze: no issuesmago guard: no issuescomposer test: 100 tests, 179 assertions, OK