PHPackages                             extended-type-system/type - 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

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

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

Typhoon Type System

0.7.0(5mo ago)643.4k↓50%2[1 PRs](https://github.com/typhoon-php/type/pulls)MITPHPPHP ^8.2CI passing

Since Mar 1Pushed 3mo ago5 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (24)Used By (0)

Typhoon Type
============

[](#typhoon-type)

[![PHP Version Requirement](https://camo.githubusercontent.com/1723ad8fa4d5bde549ec3a75c9a1efeeaa7bcfd35caf46d02ccf693acacd1fe4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f747970686f6f6e2f747970652f706870)](https://packagist.org/packages/typhoon/type)[![GitHub Release](https://camo.githubusercontent.com/9b0a5a522bd3f74daed2656e104cfbb1e4a276d736a0b7febf6b12c35e076fc3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f747970686f6f6e2d7068702f74797065)](https://github.com/typhoon-php/type/releases)[![PHPStan](https://camo.githubusercontent.com/bae4405f2c691127e0007aacdbc9e979070ddf9eab70b1ef57fcbc46af598a44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2532306c6576656c2d6d61782d627269676874677265656e2e7376673f7374796c653d666c6174266c6f676f3d706870)](phpstan.dist.neon)[![Code Coverage](https://camo.githubusercontent.com/5c3943a8a52d3626b43260ade3c1b460a19de247b988ef2faf9db22874632673/68747470733a2f2f636f6465636f762e696f2f67682f747970686f6f6e2d7068702f747970652f6272616e63682f302e382e782f67726170682f62616467652e737667)](https://codecov.io/gh/typhoon-php/type/tree/0.8.x)[![Mutation testing badge](https://camo.githubusercontent.com/d388d5c083eb2cd7b87546d3577248c4b34463da350e28dd74cf495292f63890/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246747970686f6f6e2d70687025324674797065253246302e382e78)](https://dashboard.stryker-mutator.io/reports/github.com/typhoon-php/type/0.8.x)

Typhoon Type is an object abstraction over the modern PHP type system. Use this library to build tools that work with sophisticated types:

```
use function Typhoon\Type\arrayShapeT;
use function Typhoon\Type\objectT;
use function Typhoon\Type\nonEmptyListT;

$json =  nonEmptyListT(objectT(Person::class)),
]);

$request = new Mapper()->map($json, $type);
```

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

[](#installation)

```
composer require typhoon/type

```

Printing types
--------------

[](#printing-types)

To print any type, use `stringify()`:

```
use function Typhoon\Type\stringify;

$type = arrayShapeT([
    'people' => nonEmptyListT(objectT(Person::class)),
]);

var_dump(stringify($type));

// array{'people': non-empty-list}
```

Supported types
---------------

[](#supported-types)

### Native

[](#native)

TyphoonNative`nullT``null``voidT``void``neverT``never``falseT``false``trueT``true``boolT``bool``intT``int``floatT``float``stringT``string``arrayT``array``objectT``object``objectT(Foo::class)``Foo``selfT``self``parentT``parent``staticT``static``iterableT``iterable``callableT``callable``resourceT``resource``nullOrT(stringT)``?string``unionT(intT, stringT)``int|string``intersectionT(objectT(Countable::class), objectT(Traversable::class))``Countable&Traversable``mixedT``mixed`### PHPDoc numbers

[](#phpdoc-numbers)

TyphoonPHPDoc`intT(123)``123``positiveIntT``positive-int``negativeIntT``negative-int``nonPositiveIntT``non-positive-int``nonNegativeIntT``non-negative-int``nonZeroIntT``non-zero-int``intRangeT(-5, 6)``int``intRangeT(max: 6)``int``intRangeT(min: -5)``int``intMaskT(1, 2, 4)``int-mask``intMaskT(classConstantMaskT(Foo::class, 'INT_*')``int-mask-of``floatT(12.5)``12.5``floatRangeT(-0.001, 2.344)``float`### PHPDoc strings

[](#phpdoc-strings)

TyphoonPHPDoc`nonEmptyStringT``non-empty-string``truthyStringT`, `nonFalsyStringT``truthy-string`, `non-falsy-string``numericStringT``numeric-string``lowercaseString``lowercase-string``stringT('abc')``'abc'``classT(Foo::class)`, `classStringT(Foo::class)`, `classT(objectT(Foo::class))``class-string``stringT(Foo::class)`, `classConstantT(Foo::class, 'class')``Foo::class``literalStringT``literal-string`### PHPDoc constants

[](#phpdoc-constants)

TyphoonPHPDoc`constantT('PHP_INT_MAX')``PHP_INT_MAX``constantMaskT('JSON_*')``JSON_*``classConstantT(Foo::class, 'BAR')``Foo::BAR``classConstantMaskT(Foo::class, 'IS_*')``Foo::IS_*`### PHPDoc arrays and iterables

[](#phpdoc-arrays-and-iterables)

TyphoonPHPDoc`arrayT(value: objectT(Foo::class))``Foo[]``listT(stringT)``list``nonEmptyListT(stringT)``non-empty-list``listShapeT([intT, stringT])``list{int, string}``arrayShapeT([intT, optional(stringT)])``list{int, 1?: string}``unsealedListShapeT([intT])``list{int, ...}``unsealedListShapeT([intT], stringT)``list{int, ...}``arrayT(value: stringT)``array``arrayT(intT, stringT)``array``nonEmptyArrayT(arrayKeyT, stringT)``non-empty-array``arrayShapeT()``array{}``arrayShapeT([intT, stringT])``array{int, string}``arrayShapeT([intT, 'a' => optional(stringT)])``array{int, a?: string}``unsealedArrayShapeT([intT])``array{int, ...}``unsealedArrayShapeT([floatT], intT, stringT)``array{float, ...}``keyOfT(classConstantT(Foo::class, 'ARRAY'))``key-of``valueOfT(classConstantT(Foo::class, 'ARRAY'))``value-of``offsetT($TArray->type, $TKey->type)``TArray[TKey]``iterableT(objectT, stringT)``iterable``iterableT(value: stringT)``iterable`### PHPDoc objects

[](#phpdoc-objects)

TyphoonPHPDoc`objectT(Foo::class, [stringT, floatT])``Foo``selfT([stringT, floatT])``self``parentT([stringT, floatT])``parent``staticT([stringT, floatT])``static``objectShapeT(['prop' => stringT])``object{prop: string}``objectShapeT(['prop' => optional(stringT))])``object{prop?: string}`### PHPDoc callables

[](#phpdoc-callables)

TyphoonPHPDoc`callableT([stringT], voidT)``callable(string): void``callableT([param(stringT, default: true)])``callable(string=): mixed``callableT([param(stringT, variadic: true)])``callable(string...): mixed``callableT([param(stringT, byRef: true)])``callable(string&): mixed``closureT([stringT], voidT)``Closure(string): void``closureT([param(stringT, default: true)])``Closure(string=): mixed``closureT([param(stringT, variadic: true)])``Closure(string...): mixed``closureT([param(stringT, byRef: true)])``Closure(string&): mixed`### Union aliases

[](#union-aliases)

TyphoonPHPDoc`array-key``arrayKeyT``numericT``numeric``scalarT``scalar`

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance76

Regular maintenance activity

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.6% 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 ~51 days

Recently: every ~24 days

Total

22

Last Release

97d ago

PHP version history (2 changes)0.1.0PHP ^8.1

0.5.0PHP ^8.2

### 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 (494 commits)")[![klimick](https://avatars.githubusercontent.com/u/34217190?v=4)](https://github.com/klimick "klimick (2 commits)")

---

Tags

phpphp-library

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/support

The Illuminate Support package.

582107.1M34.5k](/packages/illuminate-support)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[illuminate/collections

The Illuminate Collections package.

27071.5M822](/packages/illuminate-collections)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[orchestra/sidekick

Packages Toolkit Utilities and Helpers for Laravel

1214.3M14](/packages/orchestra-sidekick)

PHPackages © 2026

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