Skip to content

fix(Type): report any docblock the type resolver fails on - #2393

Merged
DerManoMann merged 1 commit into
zircote:masterfrom
DerManoMann:fix/docblock-errors
Nov 11, 2026
Merged

DerManoMann merged 1 commit into
zircote:masterfrom
DerManoMann:fix/docblock-errors

Conversation

@DerManoMann

Copy link
Copy Markdown
Collaborator

Overview

A docblock class-string<T>, where T is a template, ends the build with a TypeError from radebatz/type-info-extras. TypeResolver::getDocblockType() catches only UnsupportedException and InvalidArgumentException, 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 \Throwable from the resolver and logs the existing "Unsupported docblock type" warning. The PHP type, if there is one, is used instead
  • The docblock resolver is created once, in the constructor, so a test can swap in one that throws
  • Tests for class-string<T> on a template class, and for a resolver that throws

`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.
@DerManoMann
DerManoMann merged commit 271a2f6 into zircote:master Nov 11, 2026
20 checks passed
@DerManoMann
DerManoMann deleted the fix/docblock-errors branch November 11, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant