# phpdocumentor/typeresolver

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/phpdocumentor-typeresolver).**

9,180 stars · 51 forks · PHP · MIT

## Links

- GitHub: https://github.com/phpDocumentor/TypeResolver
- awesome-repositories: https://awesome-repositories.com/repository/phpdocumentor-typeresolver.md

## Topics

`typeresolver`

## Description

TypeResolver is a PHP namespace resolver and type parser designed to convert partial class and element names into fully qualified names. It functions as a utility for static code analysis, transforming complex type expressions and primitives into structured value objects.

The project implements PSR-5 standards to ensure consistent type referencing. It manages the resolution of structural elements by tracking current namespaces and alias contexts to expand partial identifiers into their full definitions.

The tool covers the parsing of compound type strings and the management of PHP imports and aliases. It utilizes a value-object based representation to handle structural element transformations and recursive type expression parsing.

## Tags

### Data & Databases

- [Language](https://awesome-repositories.com/f/data-databases/namespace-resolution/language.md) — Resolves partial names into fully qualified identifiers by tracking the current namespace and imported aliases.

### Development Tools & Productivity

- [Import Alias Mappings](https://awesome-repositories.com/f/development-tools-productivity/command-line-configuration/alias-configurations/class-alias-definitions/import-alias-mappings.md) — Implements a lookup table for mapping imported short aliases to full structural definitions.

### Programming Languages & Runtimes

- [Identifier Resolutions](https://awesome-repositories.com/f/programming-languages-runtimes/identifier-resolutions.md) — Converts shorthand references into fully qualified names by analyzing the surrounding code context.
- [PHP Import Resolution](https://awesome-repositories.com/f/programming-languages-runtimes/module-importing/namespace-imports/php-import-resolution.md) — Resolves imports and aliases to determine exactly which class or interface a specific name refers to.
- [Namespace Resolvers](https://awesome-repositories.com/f/programming-languages-runtimes/namespace-resolvers.md) — Provides a utility for resolving structural elements and class references using current namespace and alias contexts.
- [PHP Parsers](https://awesome-repositories.com/f/programming-languages-runtimes/php-parsers.md) — Transforms complex type expressions and primitives into structured value objects for static analysis.
- [Qualified Name Resolution](https://awesome-repositories.com/f/programming-languages-runtimes/qualified-name-resolution.md) — Provides logic to resolve whether to use simple or fully qualified names for a type. ([source](https://github.com/phpdocumentor/typeresolver#readme))
- [PSR-5 Compliant Resolvers](https://awesome-repositories.com/f/programming-languages-runtimes/qualified-name-resolution/psr-5-compliant-resolvers.md) — Converts partial class and element names into fully qualified names based on PSR-5 standards.

### Software Engineering & Architecture

- [PHP Type Resolvers](https://awesome-repositories.com/f/software-engineering-architecture/static-type-checkers/php-type-checkers/php-type-resolvers.md) — Converts partial class and type names into fully qualified names based on namespace and alias contexts.
- [Recursive Type Processing](https://awesome-repositories.com/f/software-engineering-architecture/recursive-type-processing.md) — Parses complex type strings into value objects using recursive type processing patterns.
- [Static Code Analyzers](https://awesome-repositories.com/f/software-engineering-architecture/static-code-analyzers.md) — Parses type expressions and compound strings into value objects for static analysis without execution.
- [Type Representation Objects](https://awesome-repositories.com/f/software-engineering-architecture/type-representation-objects.md) — Encapsulates parsed type information within immutable value objects to ensure type safety during resolution.
- [Expression Type Resolution](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/static-type-checking/expression-type-resolution.md) — Parses type strings including primitives and compounds into descriptive value objects. ([source](https://github.com/phpdocumentor/typeresolver#readme))

### User Interface & Experience

- [Language Element Resolutions](https://awesome-repositories.com/f/user-interface-experience/ui-element-selectors/element-structure-typing/language-element-resolutions.md) — Transforms references to classes, interfaces, and methods into fully qualified structural element names. ([source](https://github.com/phpdocumentor/typeresolver#readme))

### Web Development

- [PSR-5 Implementations](https://awesome-repositories.com/f/web-development/web-standards/standards-compliant-implementations/php-standard-implementations/psr-5-implementations.md) — Implements the PSR-5 standard for structural element naming to ensure consistent type referencing.
