PHPackages                             inteve/types - 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. inteve/types

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

inteve/types
============

Value objects and helpers for PHP.

v2.1.1(10mo ago)28.5k—0%2BSD-3-ClausePHPPHP 8.0 - 8.4CI passing

Since Aug 13Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/inteve/types)[ Packagist](https://packagist.org/packages/inteve/types)[ Fund](https://www.janpecha.cz/donate/)[ RSS](/packages/inteve-types/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (14)Used By (2)

Inteve\\Types
=============

[](#intevetypes)

[![Build Status](https://github.com/inteve/types/workflows/Build/badge.svg)](https://github.com/inteve/types/actions)[![Downloads this Month](https://camo.githubusercontent.com/33d9c4503b790b41daebe72fcb40980b99e35446eec79e6872dc4b4ce275a623/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f696e746576652f74797065732e737667)](https://packagist.org/packages/inteve/types)[![Latest Stable Version](https://camo.githubusercontent.com/bd6ee5fa897966d06e71883dcf3c133000c227ed5e78fa6c857f5a1591a8a2a3/68747470733a2f2f706f7365722e707567782e6f72672f696e746576652f74797065732f762f737461626c65)](https://github.com/inteve/types/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/inteve/types/blob/master/license.md)

Value objects and helpers for PHP.

[![Donate](https://camo.githubusercontent.com/101b981194f1dafbf9c42e19c3034fe2d724e75be972cef0f4477074997834db/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f646f6e6174652d62616e6e65722e76312e737667)](https://www.janpecha.cz/donate/)

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

[](#installation)

[Download a latest package](https://github.com/inteve/types/releases) or use [Composer](http://getcomposer.org/):

```
composer require inteve/types

```

Inteve\\Types requires PHP 8.0 or later.

Usage
-----

[](#usage)

- BinaryData
- EmailAddress
- [DatabaseDataType](#databasedatatype)
- Decimal
- [HexColor](#hexcolor)
- [Html](#html)
- IpAddress
- [Md5Hash](#md5hash)
- Password
- [PhpType](#phptype)
- [PhpParameterType](#phpparametertype)
- UniqueId
- [Url](#url)
- UrlPath
- UrlSlug

### DatabaseDataType

[](#databasedatatype)

```
use Inteve\Types\DatabaseDataType;

$type = new DatabaseDataType('INT', [10], ['UNSIGNED']);
$type->getType();
$type->getParameters();
$type->getOptions();
$type->hasOption('UNSIGNED'); // returns TRUE
$type->getOptionValue('UNSINGED'); // returns mixed|NULL
```

### HexColor

[](#hexcolor)

```
use Inteve\Types\HexColor;

$color = new HexColor('0088FF');
$color->getValue(); // returns '0088ff'
$color->getCssValue(); // returns '#0088ff'

// from CSS color
$color = HexColor::fromCssColor('#0088ff');
```

### Html

[](#html)

```
use Inteve\Types\Html;

$html = new Html('Lorem &gt; ipsum');
$html->getHtml();
(string) $html; // alias for getHtml()

$html->getPlainText(); // returns text without HTML tags & entities ('Lorem > ipsum')
```

It implements `Nette\Utils\IHtmlString` so can be used directly in Latte template (`{$html}`) without `|noescape` modifier.

### Md5Hash

[](#md5hash)

```
use Inteve\Types\Md5Hash;

$md5 = new Md5Hash($hash);
$md5->getHash(); // returns $hash

// from string
$md5 = Md5Hash::from('Lorem ipsum dolor.');

// from file
$md5 = Md5Hash::fromFile('/path/to/file');
```

### PhpType

[](#phptype)

```
use Inteve\Types\PhpType;

$type = new PhpType('bool');
$type->getType();
(string) $type; // alias for getType()
$type->isBasicType(); // returns TRUE

$type = new PhpType(PhpType::class);
$type->isBasicType(); // returns FALSE
```

You can use static factories:

```
$type = PhpType::arrayType();
$type = PhpType::boolType();
$type = PhpType::floatType();
$type = PhpType::intType();
$type = PhpType::stringType();
$type = PhpType::classType(PhpType::class);

$type = PhpType::fromParameterType(new PhpParameterType('string'));
```

It implements `Inteve\Types\IPhpParameterType`.

### PhpParameterType

[](#phpparametertype)

```
use Inteve\Types\PhpParameterType;

$type = new PhpParameterType('bool');
$type->getType();
(string) $type; // alias for getType()
$type->isBasicType(); // returns TRUE

$type = new PhpParameterType(PhpParameterType::class);
$type->isBasicType(); // returns FALSE
```

You can use static factories:

```
$type = PhpParameterType::arrayType();
$type = PhpParameterType::boolType();
$type = PhpParameterType::floatType();
$type = PhpParameterType::intType();
$type = PhpParameterType::stringType();
$type = PhpParameterType::callableType();
$type = PhpParameterType::iterableType();
$type = PhpParameterType::selfType();
$type = PhpParameterType::objectType();
$type = PhpParameterType::classType(PhpParameterType::class);

$type = PhpParameterType::fromPhpType(new PhpType('string'));
```

It implements `Inteve\Types\IPhpParameterType`.

### Url

[](#url)

```
use Inteve\Types\Url;

$url = new Url('https://example.com/page');
$url->getUrl();
(string) $url; // alias for getUrl()
```

---

License: [New BSD License](license.md)
Author: Jan Pecha,

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance53

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

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

Recently: every ~340 days

Total

13

Last Release

322d ago

Major Versions

v0.5.0 → v1.0.02021-09-09

v1.1.2 → v2.0.02023-07-05

PHP version history (3 changes)v0.1.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.2.0

v2.1.0PHP 8.0 - 8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c980b1511b4a0350442dc23d89c99d4d9a2411b7e765d52c133ccacf616968b?d=identicon)[janpecha](/maintainers/janpecha)

---

Top Contributors

[![janpecha](https://avatars.githubusercontent.com/u/637719?v=4)](https://github.com/janpecha "janpecha (52 commits)")

---

Tags

datatypesphp

### Embed Badge

![Health badge](/badges/inteve-types/health.svg)

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

###  Alternatives

[laminas/laminas-stdlib

SPL extensions, array utilities, error handlers, and more

236103.2M438](/packages/laminas-laminas-stdlib)

PHPackages © 2026

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