A PSR-5 based resolver of Class names, Types and Structural Element Names
9.2k
Stars
51
Forks
10
Open issues
30
Contributors
AI Analysis
TypeResolver is a PHP library that implements PSR-5 specification for resolving type declarations and fully qualified structural element names (FQSENs) from DocBlocks. It specializes in parsing PHP documentation annotations to convert partial class names into fully qualified names and resolve complex type expressions. This tool is essential for documentation generators, static analysis tools, and IDEs that need to interpret PHP documentation metadata.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
PHP DocBlock type resolver that quietly powers millions of projects as a silent dependency
phpDocumentor/TypeResolver implements PSR-5 type parsing and resolution for PHP DocBlocks, converting type strings like 'string|int[]' or partial class names into structured value objects with full namespace context. It is built primarily for static analysis tools, documentation generators, IDE plugins, and PHP reflection libraries. Despite modest star counts relative to its actual reach, it is a foundational transitive dependency for tools like PHPStan, Psalm, and phpDocumentor itself, meaning its real adoption is orders of magnitude larger than repository metrics suggest.
Created in June 2015 as part of the phpDocumentor ecosystem to formalize PSR-5 type handling. It evolved alongside PSR-5 draft specification and has been a stable infrastructure component for over a decade.
Star growth is nearly flat (1 star in 7 days) because this is infrastructure code — developers rarely star transitive dependencies. Actual adoption grew with the explosion of PHP static analysis tooling (PHPStan, Psalm) in the 2017–2022 period. Its Packagist download counts (not available here but known to be in the hundreds of millions) tell the real growth story.
While direct adoption evidence is not verifiable from this repository alone, phpDocumentor/TypeResolver is a declared dependency of phpDocumentor/ReflectionDocBlock (9,384 stars), which is itself a dependency of PHPUnit, PHPStan, Psalm, and Symfony components. Packagist monthly downloads are publicly known to be in the tens of millions. Adoption is extensively documented through the transitive dependency graph of the PHP ecosystem.
Appears to follow a clean value object pattern with distinct TypeResolver and FqsenResolver classes. Types are modeled as typed value objects (Compound, Nullable, String_, Integer, etc.), suggesting an immutable, composable design. Context object carries namespace and import information for partial name resolution — appears well-separated from parsing logic.
README links to Coveralls and Scrutinizer coverage badges for branch 1.x, indicating automated coverage tracking is in place. Scrutinizer quality badge also present. Exact coverage percentage is not stated in the README excerpt, but the presence of multiple coverage systems suggests the project takes testing seriously.
Last push was April 2, 2026 — approximately 12 weeks before the evaluation date. This indicates active maintenance. The CI badge (GitHub Actions QA workflow) is present and tied to branch 1.x. For a mature, stable library, infrequent commits are expected and do not indicate abandonment.
ADOPT IF: you are building a PHP static analysis tool, documentation generator, IDE language server, or reflection library that needs to parse and resolve PSR-5 DocBlock types — this is the de facto standard component for that job. AVOID IF: you need runtime type enforcement or PHP 8 native type introspection from source code rather than DocBlocks — this library is scoped to string-based DocBlock type resolution only. MONITOR IF: PSR-5 is finalized or amended in ways that require breaking API changes, or if PHPStan's phpdoc-parser gains sufficient abstraction to displace this as the ecosystem standard.
Independent dimensions
Mainstream potential
3/10
Technical importance
8/10
Adoption evidence
8/10
- PSR-5 remains a draft standard; any significant changes to the specification could require breaking changes to the library's API.
- PHPStan's phpdoc-parser is gaining adoption as an alternative within the static analysis community and could fragment ecosystem standards.
- As a transitive dependency, the library has limited direct community engagement — issues and maintenance depend heavily on the phpDocumentor core team's bandwidth.
- PHP's evolution toward native union types, intersection types, and enums may reduce reliance on DocBlock-based type annotation over time, slowly shrinking the problem domain.
- Low fork count (51) relative to star count may indicate limited external contributor pool, concentrating maintenance risk in the core team.
Will remain stable critical infrastructure for the PHP ecosystem for the foreseeable future. Unlikely to see dramatic growth or decline — its fate is tied to the longevity of DocBlock-based type annotations in PHP codebases.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- PHP
- License
- MIT
- Last updated
- 3mo ago
- Created
- 135mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Recent releases
Similar repos
phpDocumentor/phpDocumentor
phpDocumentor is a specialized documentation generator for PHP projects that...
phpDocumentor/ReflectionDocBlock
ReflectionDocBlock is a PHP library that parses DocBlocks (documentation...
phpDocumentor/ReflectionCommon
ReflectionCommon is a PHP library providing shared reflection interfaces and...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
9.2k | +1 | PHP | 8/10 | 3mo ago |
|
|
4.3k | — | PHP | 7/10 | 4d ago |
|
|
9.4k | — | PHP | 8/10 | 4mo ago |
|
|
9.1k | — | PHP | 8/10 | 8mo ago |
|
|
1.5k | — | PHP | 8/10 | 2d ago |
|
|
11.2k | — | PHP | 8/10 | 4w ago |
Sibling library that depends on TypeResolver. ReflectionDocBlock handles full DocBlock parsing; TypeResolver handles the type-string resolution layer specifically. They are complementary, not competing.
PHPStan's own DocBlock parser that also resolves types. More tightly integrated with PHPStan internals and supports extended PHPStan-specific type syntax. TypeResolver is more PSR-5 standards-aligned and framework-agnostic.
Lower-level lexer utility used for tokenization, not type resolution. TypeResolver operates at a higher abstraction level. They solve different layers of the same parsing pipeline.
Full PHP code parser that can also extract type information from PHP source AST. TypeResolver specifically targets DocBlock type strings per PSR-5, not native PHP syntax — different scope and use case.
TypeScript library for GraphQL schema generation — not a PHP type resolver. Listed as similar by tooling but not a real competitor or alternative for this project's use case.