radebatz/type-info-extras
Extra type information helpers for radebatz/type-info. Adds additional utilities for describing, inspecting, and working with PHP types, improving reflection-based tooling and type metadata in your projects.
Start by installing the package alongside symfony/type-info (v7.3.8+ or v7.4.1+ or v8.0+). It’s designed as a drop-in extension — no complex setup required. Once installed, the extras are automatically registered via Symfony’s autowiring or manual service registration if needed. The first practical use is extending type resolution for advanced PHPDoc annotations (e.g., @phpstan-type, @psalm-type, or custom shape-like structures) that symfony/type-info alone cannot fully parse. Check the README (if available) or inspect the src/ folder for supported types — especially ObjectShapeType and improved array resolution in v1.0.6+.
TypeInfo extension to accurately resolve types from complex PHPDoc, such as @return array{foo: string, bar: int} or union types with generic-like shapes. Ideal for automated DTO/VO validation, API schemas, or ORM-like metadata extraction.symfony/type-info falls back to mixed for @phpstan-type-defined shapes, this package adds support for ObjectShapeType, enabling more precise reflection — useful in static analysis tooling or schema generation.Type instances beyond basic scalars or class names.TypeError or autoloading issues.symfony/type-info — it extends it. You must still instantiate/autowire the base TypeResolver and augment it with the extras.symfony/type-info branches (^7.3.8, ^7.4.1, ^8.0, ^8.1-@dev), use Composer’s version constraints carefully — mixing incompatible symfony/* versions may cause runtime type errors or missing classes. Check composer.json’s require section before upgrading.suggests/conflicts: The package doesn’t declare conflicts or optional integrations — test in isolation if using alongside phpstan/extension-installer or phpstan/phpdoc-parser v1.x (unsupported).var_dump($type->toString()) to inspect resolved ObjectShapeType members — the internal shape keys may differ from PHPDoc string representation, especially with @phpstan-type aliases.How can I help you explore Laravel packages today?