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

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

innmind/type
============

1.2.0(2y ago)120.2k↓47.7%[2 issues](https://github.com/Innmind/type/issues)2MITPHPPHP ~8.2

Since Jul 16Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Innmind/type)[ Packagist](https://packagist.org/packages/innmind/type)[ Docs](http://github.com/innmind/type)[ RSS](/packages/innmind-type/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (2)

type
====

[](#type)

[![Build Status](https://github.com/innmind/type/workflows/CI/badge.svg?branch=main)](https://github.com/innmind/type/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/41aa151bb459e0425df87d1166b02072ccfd74cadff45c0e6acc664a8d2d3382/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f747970652f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/type)[![Type Coverage](https://camo.githubusercontent.com/9408008efe5ee6436b52eb4f54b3962456a81148ee5cc0e0ee2725d62b7c4b27/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f747970652f636f7665726167652e737667)](https://shepherd.dev/github/innmind/type)

This package allows to describe types as objects to check if a given type can accept a value or if it is compatible with another type.

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

[](#installation)

```
composer require innmind/type
```

Usage
-----

[](#usage)

```
use Innmind\Type\{
    Build,
    Primitive,
};

final class Example
{
    private int $id;
}

$type = Build::fromReflection((new \ReflectionProperty(Example::class, 'id'))->getType());
$type->allows(42); // true
$type->allows('some-uuid'); // false

$type->accepts(Primitive::int()); // true
$type->accepts(Primitive::string()); // false
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

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

Total

3

Last Release

821d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (15 commits)")

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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