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

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

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

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

0.4.0(5y ago)1842MITPHPPHP ^7.4|^8.0

Since Dec 21Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (8)Used By (2)

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

[](#common-types)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8dda548fb24c509b36a3e0f1cda1fc5790a1a6acd98685e2d609fa59940b48b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65646961676f6e652f636f6d6d6f6e2d74797065732e737667)](https://packagist.org/packages/mediagone/common-types)[![Total Downloads](https://camo.githubusercontent.com/f281b0f2804d8b5244130d8bc3d129da455b03634a372dd795115ce77b1a30c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65646961676f6e652f636f6d6d6f6e2d74797065732e737667)](https://packagist.org/packages/mediagone/common-types)[![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.

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

[](#installation)

This package requires **PHP 7.4+**

Add it as Composer dependency:

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

List of available Value Objects
-------------------------------

[](#list-of-available-value-objects)

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

### Crypto

[](#crypto)

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

### System

[](#system)

- `Age`
- `Count`
- `Country`
- `Date`
- `DateTimeUTC`
- `Duration`

### Text

[](#text)

- `Hex`
- `Name`
- `Slug`
- `Text`
- `TextMedium`
- `Title`

### Web

[](#web)

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

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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

Total

7

Last Release

1957d ago

PHP version history (2 changes)0.1.0PHP ^7.4

0.3.2PHP ^7.4|^8.0

### 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 (25 commits)")

---

Tags

clean-codetypesvalue-objectstypevalue objectsddd

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k579.0M173](/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.8M269](/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.7k49](/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)
