PHPackages                             getwarp/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. getwarp/type

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

getwarp/type
============

Runtime type checking and casting in PHP

3.1.2(3y ago)19094MITPHPPHP ^7.4|^8.0

Since Apr 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/getwarp/type)[ Packagist](https://packagist.org/packages/getwarp/type)[ Docs](https://github.com/getwarp/type)[ GitHub Sponsors](https://github.com/getwarp)[ GitHub Sponsors](https://github.com/hustlahusky)[ RSS](/packages/getwarp-type/feed)WikiDiscussions 3.1.x Synced 1mo ago

READMEChangelogDependencies (5)Versions (9)Used By (4)

getwarp/type
============

[](#getwarptype)

Runtime type checking and casting in PHP

[GitHub](https://github.com/getwarp/type) • [Packagist](https://packagist.org/packages/getwarp/type) • [Installation](#installation) • [Usage](#usage)

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

[](#installation)

Via Composer

```
$ composer require getwarp/type
```

Usage
-----

[](#usage)

```
use Warp\Type\BuiltinType;

$int = BuiltinType::int();
\assert(true === $int->check(1));
\assert(false === $int->check('string'));
```

You can also use factory to create type object from string

```
use Warp\Type\Factory\TypeFactoryAggregate;
use Warp\Type\Factory\MemoizedTypeFactory;

$factory = new MemoizedTypeFactory(TypeFactoryAggregate::default());
$factory->make('int');
$factory->make('string[]');
$factory->make('array');
$factory->make('int|null');
$factory->make('Traversable|iterable|null');
$factory->make('Traversable&JsonSerializable');
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

[Report issues](https://github.com/getwarp/warp/issues) and [send pull requests](https://github.com/getwarp/warp/pulls) in the [main Warp repository](https://github.com/getwarp/warp). Please see [contributing guide](https://github.com/getwarp/warp/blob/3.1.x/CONTRIBUTING.md) and [code of conduct](https://github.com/getwarp/.github/blob/main/CODE_OF_CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Constantine Karnaukhov](https://github.com/hustlahusky)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [license file](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

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 ~41 days

Recently: every ~69 days

Total

9

Last Release

1161d ago

Major Versions

2.5.3 → 3.0.02022-04-22

2.5.x-dev → 3.0.22022-06-12

PHP version history (2 changes)2.5.3PHP ^7.2|^8.0

3.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3947942?v=4)[Constantine Karnaukhov](/maintainers/tntrex)[@tntrex](https://github.com/tntrex)

---

Top Contributors

[![tntrex](https://avatars.githubusercontent.com/u/3947942?v=4)](https://github.com/tntrex "tntrex (9 commits)")

---

Tags

typecasttype-check

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k541.2M159](/packages/phpoption-phpoption)[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)[jetbrains/phpstorm-stubs

PHP runtime &amp; extensions header files for PhpStorm

1.4k27.7M68](/packages/jetbrains-phpstorm-stubs)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49644.8M97](/packages/marc-mabe-php-enum)[symfony/type-info

Extracts PHP types information.

19951.9M114](/packages/symfony-type-info)[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)

PHPackages © 2026

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