Repository navigation
fix(Type): report any docblock the type resolver fails on - #2393
Merged
Merged
Conversation
`getDocblockType()` catches any `\Throwable` from the docblock resolver and logs the existing "Unsupported docblock type" warning. The resolver is created once, in the constructor, rather than per tag.
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.
Overview
A docblock
class-string<T>, whereTis a template, ends the build with aTypeErrorfromradebatz/type-info-extras.TypeResolver::getDocblockType()catches onlyUnsupportedExceptionandInvalidArgumentException, the two exceptions the resolver declares, so anything else passes straight through.The resolver itself is fixed in DerManoMann/type-info-extras#32, but a build should not depend on the resolver failing only in the ways it declares. A docblock it cannot read is reported and skipped, like any other unsupported type.
Changes
getDocblockType()catches any\Throwablefrom the resolver and logs the existing "Unsupported docblock type" warning. The PHP type, if there is one, is used insteadclass-string<T>on a template class, and for a resolver that throws