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

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

mediagone/types-common
======================

A collection of generic Value Objects you should (always) use instead of primitive types!

0.8.1(3mo ago)14.1k↓50%4MITPHPPHP ^7.4|^8.0

Since Mar 9Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Mediagone/types-common)[ Packagist](https://packagist.org/packages/mediagone/types-common)[ RSS](/packages/mediagone-types-common/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (46)Used By (4)

Types Common
============

[](#types-common)

[![Latest Version on Packagist](https://camo.githubusercontent.com/714e24585e4c9fe8e407eaa8fe862679b36542a0ecd15412edaf8fff59989a51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65646961676f6e652f74797065732d636f6d6d6f6e2e737667)](https://packagist.org/packages/mediagone/types-common)[![Total Downloads](https://camo.githubusercontent.com/395d3551d3f97d3cca3f93823e3162c71ee08c3293bb6ffa29d8689106d2a753/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65646961676f6e652f74797065732d636f6d6d6f6e2e737667)](https://packagist.org/packages/mediagone/types-common)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

Value Objects are small and **immutable** classes representing typed values usually implemented using PHP primitive types. However, objects can embed validation to ensure that your data is **always valid** without adding any check elsewhere in your code. That's why you should ALWAYS use Value Objects rather than primitive types!

This package provides most common types you can use in any project.

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

[](#installation)

This package requires **PHP 7.4+**

Add it as Composer dependency:

```
$ composer require mediagone/types-common
```

Available value-objects
-----------------------

[](#available-value-objects)

All value-objects implement a common `ValueObject` interface and `JsonSerializable`.

### Business

[](#business)

- `Bic`
- `Iban`

### Crypto

[](#crypto)

- `Hash` (abstract class)
- `HashBcrypt`
- `HashArgon2id`
- `RandomToken`
- `Sha512`

*Note: all Hash\* types are based on `Hash` base class, so they are perfectly interoperable.*

### Geo

[](#geo)

- `Address`
- `City`
- `Country`
- `Latitude`
- `Longitude`

### Graphics

[](#graphics)

- `Color`

### System

[](#system)

- `Age`
- `Base64`
- `Binary`
- `Count`
- `Date`
- `DateTimeUTC`
- `DayOfMonth`
- `Duration`
- `Hex`
- `Quantity`

### Text

[](#text)

- `Name`
- `NameDigit`
- `NameSpecial`
- `Slug`
- `SlugSnake`
- `Text`
- `TextMedium`
- `Title`

### Web

[](#web)

- `EmailAddress`
- `Url`
- `UrlHost`
- `UrlPath`

License
-------

[](#license)

*Types Common* is licensed under MIT license. See LICENSE file.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance81

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~263 days

Total

45

Last Release

99d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32240357?v=4)[Bruce](/maintainers/Mediagone)[@Mediagone](https://github.com/Mediagone)

---

Top Contributors

[![Mediagone](https://avatars.githubusercontent.com/u/32240357?v=4)](https://github.com/Mediagone "Mediagone (84 commits)")

---

Tags

clean-codetypesvalue-objectstypevalue objectsddd

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k579.0M176](/packages/phpoption-phpoption)[jetbrains/phpstorm-stubs

PHP runtime &amp; extensions header files for PhpStorm

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

Simple and fast implementation of enumerations with native PHP

50458.3M110](/packages/marc-mabe-php-enum)[symfony/type-info

Extracts PHP types information.

20069.8M270](/packages/symfony-type-info)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[space48/auto-value

Generated immutable value classes for PHP7.1+

291.6k](/packages/space48-auto-value)

PHPackages © 2026

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