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(1mo ago)14.0k↓50%4MITPHPPHP ^7.4|^8.0

Since Mar 9Pushed 1mo 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 1mo ago

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

49

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

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

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce000f43f69a7dc38a80da57d86a712a3e27f86b5fd4090f024472a03b28a089?d=identicon)[Mediagone](/maintainers/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.7k541.2M159](/packages/phpoption-phpoption)[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)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[phpmentors/domain-kata

Kata for domain models

73426.9k9](/packages/phpmentors-domain-kata)

PHPackages © 2026

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