Skip to content
CAI
Software that uses CAICheck a score

phpDocumentor/TypeResolver

69.1

Adequate · 13 November 2026

4.3k

lines of production code

PHP

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a PHP library for reflecting and resolving PHPDoc type annotations, providing a robust engine to parse complex type structures including generics, pseudo-types, and modern PHP syntax. It exposes APIs for resolving types and fully qualified structural element names within a given context, supporting detailed analysis of array shapes, conditional types, and resource states. The library includes comprehensive unit and benchmark tests to ensure accuracy and performance of its type resolution components.

Features

Expanded support for Psalm pseudo-types

The type reflection engine in src/PseudoTypes now recognizes a comprehensive suite of Psalm pseudo-types, enabling more precise documentation and analysis. New additions include array and object shapes (ArrayShape, ObjectShape), list variants (List\_, NonEmptyList), and integer ranges (IntegerRange). The update also introduces specialized string types (e.g., literal-string, non-falsy-string, enum-string), resource states (open-resource, closed-resource), and advanced type operators like Conditional, KeyOf, and PropertiesOf. This allows the tool to correctly parse and represent complex type constraints found in modern PHP codebases.

src/PseudoTypes · high confidence

New base template for PHPDocumentor documentation site

A new base Twig template has been added to the PHPDocumentor configuration, defining the main navigation menu (About, Components, Documentation) and social links (Mastodon, GitHub, Discussions) for the generated documentation site.

.phpdoc · high confidence

Behavioural changes

Full rewrite of type resolving with extensive pseudo-type support

The type resolution engine has been completely rewritten to support a comprehensive set of modern PHPDoc pseudo-types and syntaxes. Users can now resolve complex type annotations including array shapes, generics, conditional types, and specific scalar constraints such as \int\<min,max\>\, \non-empty-array\, \class-string\, \interface-string\, \callable-array\, and resource states (\open-resource\, \closed-resource\). The \TypeResolver\ now leverages the \PHPStan\\PhpDocParser\ for accurate parsing, and the \FqsenFactory\ has been renamed to \FqsenResolver\ to better reflect its role in resolving fully qualified structural element names within a context.

src · high confidence

Refactored type system with new value objects and support for intersection and never types

The type representation layer in src/Types has been significantly restructured to support modern PHPDoc standards and newer PHP features. New value objects have been introduced for intersection types (Intersection), the never return type (Never\), and expression types (Expression), while existing types like Array\ and Iterable\_ now extend a shared AbstractList base. Several legacy type classes (Float, Mixed, Resource, String, Void) have been renamed with a trailing underscore (e.g., Float\) to avoid conflicts with reserved keywords, and the Scalar type has been repurposed to represent the 'parent' type. The Callable\ type now supports detailed parameter and return type information via a new CallableParameter class, and Self\_ and Static\_ types now support generic type arguments. Additionally, the old Resolver class has been removed in favor of a refactored ContextFactory that handles a broader range of Reflector types, and all type classes now include strict typing and Psalm immutability annotations.

src/Types · high confidence

Standardized development environment and CI tooling

The project has replaced the legacy Travis CI and Scrutinizer setup with a modern, standardized workflow using GitHub Actions, Docker-based tooling, and updated static analysis configurations. Users and contributors will now benefit from enforced coding standards via \.editorconfig\ and \phpcs.xml.dist\, stricter type checking with PHPStan (level max) and Psalm (level 1), and a streamlined Makefile for running tests, benchmarks, and documentation generation. The CI pipeline now excludes development artifacts from distributions via \.gitattributes\ and provides clearer test reporting through verbose PHPUnit output and coverage reports.

(repo-wide) · high confidence

Updated examples to use new TypeResolver and FqsenResolver APIs

The example scripts have been updated to reflect API changes in the phpDocumentor Reflection library. The old \Types\\Resolver\ class has been replaced by \TypeResolver\ and \FqsenResolver\, with method calls changing from \resolveType\/\resolveFqsen\ to \resolve\. Additionally, the \ContextFactory\ now uses \createFromReflector\ instead of \createFromClassReflector\, and the require paths have been adjusted to support running examples from any directory. A new example (05) demonstrates discovering context via method reflection, while the previous file-content example was removed.

examples · high confidence

Test coverage

Added benchmark tests for phpDocumentor reflection components; Added unit tests for PHP type reflection classes; Added unit tests for PseudoTypes; Added unit tests for type resolution components.

Dependencies

Upgrade to PHP 7.4+ and modernize static analysis dependencies

The project now requires PHP 7.4 or higher, dropping support for older versions. It has upgraded its static analysis tooling by introducing phpstan/phpdoc-parser ^2.0 and doctrine/deprecations ^1.0, while updating phpdocumentor/reflection-common to ^2.0. Development dependencies have also been updated, including phpunit/phpunit to ^9.5 and phpstan/phpstan to ^2.1, ensuring compatibility with the new PHP version and modern tooling standards.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 69 (+3.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 98 → 97 (-1.1)
  • Architecture 100 → 100 (-0.0)
  • Maturity 54 → 54 (+0.0)
  • Readiness 65 → 67 (+2.3)
  • Security 73 → 91 (+18.7)
  • Performance 100 → 100 (+0.0)

Resolved (9)

  • Ambiguous naming of 'resolve' method across different resolver types. While the parameters differ (string vs fqsen string), the method name 'resolve' is overloaded in intent. One resolves a full type string to a Type object, the other resolves a short FQSEN string to an Fqsen object. This can be confusing when looking at the API surface as 'resolve' usually implies parsing a complex structure, whereas the FqsenResolver is doing namespace resolution.
  • Leaked secret: crypto-key-passphrase (.github/workflows/integrate.yaml)
  • No SBOM
  • No artifact signing
  • No build provenance
  • Secret: crypto-key-passphrase (.github/workflows/integrate.yaml)
  • Secret: crypto-key-passphrase (.github/workflows/integrate.yaml)
  • Secret: crypto-key-passphrase (.github/workflows/integrate.yaml)
  • Unpinned build actions

New (2)

  • Edited copy of a member (5 corresponding lines) (src/PseudoTypes/Conditional.php)
  • Edited copy of a member (8 corresponding lines) (src/PseudoTypes/Conditional.php)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

phpDocumentor/TypeResolver was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit dbe2133bb23e2e33a6834f4ed417f24a1b167769 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.64+preprod-569132d3dfbe.