phpDocumentor/TypeResolver
63.8
Adequate · 26 September 2026
4.3k
lines of production code
PHP
primary language
4
measurements over time
What this system is
Features
Add base template for PHPDoc UI
A new base Twig template (.phpdoc/template/base.html.twig) was added, defining the main layout structure and navigation menu for the PHPDoc documentation site. This template extends 'layout.html.twig' and includes top-level menu items (About, Components, Documentation) and social media links (Mastodon, GitHub, Email).
.phpdoc · medium confidence
Expanded support for advanced type annotations
The library now recognizes a wide range of new pseudo-types, including \array-key\, \callable-array\, \callable-string\, \class-string\, \closed-resource\, \conditional\, \enum-string\, \false\, \generic\, \html-escaped-string\, \int-mask\, \int-mask-of\, \int\<min,max\>\, \interface-string\, \key-of\, \literal-string\, \lowercase-string\, \negative-int\, \never-return\/\never-returns\/\no-return\, \non-empty-array\/\non-empty-list\, \non-empty-lowercase-string\, \non-empty-string\, \non-falsy-string\, \non-negative-int\, \non-positive-int\, \non-zero-int\, \numeric\, \numeric-string\, \object\/\list\ shapes, \offset-access\, \open-resource\, \positive-int\, \properties-of\ (and its \public\/\protected\/\private\ variants), \scalar\, and \true\/\truthy-string\. This allows for more precise type hinting and documentation in PHPDoc blocks.
src/PseudoTypes · high confidence
Behavioural changes
Modernized CI, code quality, and testing configuration
The project migrated its continuous integration from Travis CI to GitHub Actions and replaced the Scrutinizer integration with dedicated static analysis tools (PHPStan, Psalm, PHPCS, and YAMLLint) to enforce code style and catch errors. The PHPUnit configuration was updated to run in verbose mode, generate Clove/JUnit reports, and use a more specific test suite structure. Additionally, new configuration files (.editorconfig, .gitattributes, .git-blame-ignore-revs, and various linter configs) were added to standardize formatting and exclude development artifacts from the repository.
(repo-wide) · high confidence
Refactored type resolution and introduced PseudoType interface
The type resolution system was refactored, introducing a new \PseudoType\ interface and a comprehensive \TypeResolver\ class that maps numerous PHPDoc keywords (such as \class-string\, \non-empty-array\, \int\<min,max\>\, and \never\) to specific value objects. Additionally, the \FqsenFactory\ was renamed to \FqsenResolver\ and updated with stricter type hints and error handling.
src · high confidence
Refactored type system with new base classes and expanded type support
The type system has been refactored to support modern PHP features and improve internal structure. A new \AggregatedType\ base class now underpins \Compound\ and \Intersection\ types, while \AbstractList\ serves as the base for \Array\\ and \Iterable\\. The \Resolver\ class has been removed in favor of direct type instantiation. Several type classes have been renamed to avoid PHP reserved keywords (e.g., \Void\ to \Void\\, \Mixed\ to \Mixed\\). New types have been added, including \Never\\ for the \never\ return type, \Expression\ for PSR-5 expressions, and \CallableParameter\ to represent callable parameters. \Self\\ and \Static\_\ now support generic types, and \ContextFactory\ has been updated to handle various \Reflector\ types.
src/Types · high confidence
Update examples to use new TypeResolver and FqsenResolver APIs
The example scripts in the 'examples' directory have been updated to use the new \TypeResolver\ and \FqsenResolver\ classes instead of the previous \Resolver\ class. This change updates the API calls from \resolveType\ and \resolveFqsen\ to \resolve\, and adjusts the context creation to use \ContextFactory\ methods like \createFromReflector\ and \createForNamespace\. Additionally, the \Classy.php\ example class was modified to accept a \$context\ parameter in its constructor, and the path to the autoloader was corrected to use \\_\DIR\\_\ for relative path resolution.
examples · high confidence
Test coverage
Added benchmark tests for type resolution and context factory; Added unit tests for PHP type reflection classes; Added unit tests for PseudoTypes; Added unit tests for type resolution components.
Dependencies
Update PHP and dependency requirements for modern environments
The project now requires PHP 7.4 or higher, dropping support for older PHP versions. The composer.lock file has been updated to lock specific versions of key dependencies, including phpdocumentor/reflection-common 2.2.0, phpstan/phpdoc-parser 2.3.0, and doctrine/deprecations 1.1.5. Development dependencies have also been updated, notably upgrading phpunit/phpunit to ^9.5 and phpstan/phpstan to ^2.1.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 50 → 64 (+14.2)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 99 → 97 (-1.2)
- Architecture 94 → 100 (+5.9)
- Maturity 59 → 54 (-4.8)
- Readiness 33 → 60 (+27.2)
- Security 54 → 73 (+19.1)
Resolved (7)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- High: security finding (details withheld)
- LLM evaluation failed
- No exposed public API
- No tests found
- Test reliability not included
New (30)
- Ambiguous naming of 'resolve' across different domains. While the parameters differ (string vs fqsen), the method name 'resolve' is overloaded semantically. In the context of TypeResolver, it parses a string into a Type AST. In FqsenResolver, it parses a string into an Fqsen AST. This is a minor inconsistency in naming convention where 'parse' or 'parseFqsen' might be more distinct than 'resolve' for the latter, but given the specific input types, it is acceptable.
- ContextFactory.createForNamespace (cognitive 25) (src/Types/ContextFactory.php)
- ContextFactory.extractUseStatements (cognitive 22) (src/Types/ContextFactory.php)
- ContextFactory.extractUseStatements (cyclomatic 30) (src/Types/ContextFactory.php)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (docs/getting-started.rst)
- Duplicated block (21 lines × 2) (src/Types/Self_.php)
- Duplicated block (23 lines × 4) (src/PseudoTypes/ClassString.php)
- Duplicated block (9 lines × 2) (src/PseudoTypes/NonEmptyArray.php)
- High CVE: [GHSA redacted] (composer.lock)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Hotspot: src/TypeResolver.php (src/TypeResolver.php)
- Inconsistent constructor parameter ordering and naming between Conditional and ConditionalForParameter. Conditional uses 'subjectType' while ConditionalForParameter uses 'parameterName'. This suggests a conceptual difference (type-based vs parameter-name-based conditionals) but the naming 'subjectType' vs 'parameterName' is not parallel. Furthermore, 'subjectType' in Conditional is likely the type being checked, whereas 'parameterName' is a string identifier. This is a design inconsistency in how the 'condition target' is represented.
- Leaked secret: crypto-key-passphrase (.github/workflows/integrate.yaml)
- …and 10 more
Written by watchdog.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 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b2abba83bb2d04969e64b5b87e1406048488058f — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-a15879f6f801.