PHPackages                             extended-type-system/type-reflection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. extended-type-system/type-reflection

Abandoned → [typhoon/reflection](/?search=typhoon%2Freflection)Library[Utility &amp; Helpers](/categories/utility)

extended-type-system/type-reflection
====================================

Static PHP reflection with phpDoc support

0.4.4(1y ago)331.9k3[1 PRs](https://github.com/typhoon-php/reflection/pulls)MITPHPPHP ^8.1

Since Mar 1Pushed 1y ago4 watchersCompare

[ Source](https://github.com/typhoon-php/reflection)[ Packagist](https://packagist.org/packages/extended-type-system/type-reflection)[ Fund](https://www.tinkoff.ru/cf/1isj40pCfIc)[ RSS](/packages/extended-type-system-type-reflection/feed)WikiDiscussions 0.4.x Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (20)Used By (0)

Typhoon Reflection
==================

[](#typhoon-reflection)

[![PHP Version Requirement](https://camo.githubusercontent.com/8a20f72e66e5ec9fafa6f0aa076ebaba7e58b5ab7a58453803bfe3b1e37087f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f747970686f6f6e2f7265666c656374696f6e2f706870)](https://packagist.org/packages/typhoon/reflection)[![GitHub Release](https://camo.githubusercontent.com/58182e8ed06d81e522b3237736426bf61eaa730aa4379a7e8b66c80bf9a47820/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f747970686f6f6e2d7068702f7265666c656374696f6e)](https://github.com/typhoon-php/reflection/releases)[![Psalm Level](https://camo.githubusercontent.com/c635d9854c13ee5b315f4e465c3b334af8f0c3162e7bbf4b6d222518d7d9d643/68747470733a2f2f73686570686572642e6465762f6769746875622f747970686f6f6e2d7068702f7265666c656374696f6e2f6c6576656c2e737667)](https://shepherd.dev/github/typhoon-php/reflection)[![Psalm Type Coverage](https://camo.githubusercontent.com/e75f9a55b0f85299036b0b089895d6782192885405a537971183ac1563951870/68747470733a2f2f73686570686572642e6465762f6769746875622f747970686f6f6e2d7068702f7265666c656374696f6e2f636f7665726167652e737667)](https://shepherd.dev/github/typhoon-php/reflection)[![Code Coverage](https://camo.githubusercontent.com/0ac7a2d71c9788e55adbf923e37d002ac32bf34fc99912b3c8761f65d2f70369/68747470733a2f2f636f6465636f762e696f2f67682f747970686f6f6e2d7068702f7265666c656374696f6e2f6272616e63682f302e342e782f67726170682f62616467652e737667)](https://codecov.io/gh/typhoon-php/reflection/tree/0.4.x)[![Mutation testing badge](https://camo.githubusercontent.com/b8b868885a3056fb2a463550afc049d478fa91b97ec1f168356e779899397a92/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246747970686f6f6e2d7068702532467265666c656374696f6e253246302e342e78)](https://dashboard.stryker-mutator.io/reports/github.com/typhoon-php/reflection/0.4.x)

Typhoon Reflection is an alternative to [native PHP Reflection](https://www.php.net/manual/en/book.reflection.php). It is:

- static (does not run or autoload reflected code),
- fast (due to lazy loading and caching),
- [fully compatible with native reflection](reflection/native_adapters.md),
- supports most of the Psalm and PHPStan phpDoc types,
- can resolve templates,
- does not leak memory and can be safely used with [zend.enable\_gc=0](https://www.php.net/manual/en/info.configuration.php#ini.zend.enable-gc).

Installation
------------

[](#installation)

```
composer require typhoon/reflection typhoon/phpstorm-reflection-stubs

```

`typhoon/phpstorm-reflection-stubs` is a bridge for `jetbrains/phpstorm-stubs`. Without this package internal classes and functions are reflected from native reflection without templates.

Basic Usage
-----------

[](#basic-usage)

```
use Typhoon\Reflection\TyphoonReflector;
use Typhoon\Type\types;
use function Typhoon\Type\stringify;

/**
 * @template TTag of non-empty-string
 */
final readonly class Article
{
    /**
     * @param list $tags
     */
    public function __construct(
        private array $tags,
    ) {}
}

$reflector = TyphoonReflector::build();
$class = $reflector->reflectClass(Article::class);
$tagsType = $class->properties()['tags']->type();

var_dump(stringify($tagsType)); // "list"

$templateResolver = $class->createTemplateResolver([
    types::union(
        types::string('PHP'),
        types::string('Architecture'),
    ),
]);

var_dump(stringify($tagsType->accept($templateResolver))); // "list"
```

Documentation
-------------

[](#documentation)

- [Native reflection adapters](docs/native_adapters.md)
- [Reflecting Types](docs/types.md)
- [Reflecting PHPDoc properties and methods](docs/php_doc_properties_and_methods.md)
- [Implementing custom types](docs/implementing_custom_types.md)
- [Caching](docs/caching.md)

Documentation is still far from being complete. Don't hesitate to create issues to clarify how things work.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~27 days

Total

19

Last Release

543d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

[![vudaltsov](https://avatars.githubusercontent.com/u/2552865?v=4)](https://github.com/vudaltsov "vudaltsov (634 commits)")

---

Tags

phpphp-library

### Embed Badge

![Health badge](/badges/extended-type-system-type-reflection/health.svg)

```
[![Health](https://phpackages.com/badges/extended-type-system-type-reflection/health.svg)](https://phpackages.com/packages/extended-type-system-type-reflection)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[phpdocumentor/reflection-docblock

With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.

9.4k722.2M1.2k](/packages/phpdocumentor-reflection-docblock)[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.3k132.9M468](/packages/zircote-swagger-php)[symfony/config

Helps you find, load, combine, autofill and validate configuration values of any kind

4.3k455.2M6.6k](/packages/symfony-config)[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k431.1M7.5k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
