PHPackages                             mhndev/value-objects - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. mhndev/value-objects

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

mhndev/value-objects
====================

common value Objects

1.6.0(7y ago)66772MITPHPPHP &gt;=5.4.0

Since Feb 26Pushed 7y ago2 watchersCompare

[ Source](https://github.com/mhndev/value-objects)[ Packagist](https://packagist.org/packages/mhndev/value-objects)[ RSS](/packages/mhndev-value-objects/feed)WikiDiscussions develop Synced 4w ago

READMEChangelogDependenciesVersions (27)Used By (2)

Common Value Objects
====================

[](#common-value-objects)

##### Common mostly used Value Objects I confronted through my own Projects

[](#common-mostly-used-value-objects-i-confronted-through-my-own-projects)

##### sample codes

[](#sample-codes)

```
use mhndev\valueObjects\implementations\Email;
use mhndev\valueObjects\implementations\MobilePhone;
use mhndev\valueObjects\implementations\Token;
use mhndev\valueObjects\implementations\Version;

$mobileObject = MobilePhone::fromOptions('989124444444');

echo $mobileObject->format(MobilePhone::WithZero);

### output : 09124444444

echo $mobileObject->format(MobilePhone::WithoutZero);

### output : 9124444444

echo $mobileObject->isMCI(MobilePhone::WithoutZero);

### output : true

echo $mobileObject->isMTN(MobilePhone::WithoutZero);

### output : false

$emailObject = new Email('info@example.com');

echo $emailObject->getDomain();

### output : example.com

echo $emailObject->getLocal();

### output : info

$tokenObject = new Token(
    'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImVhMTY3OTQ',
    Token::SCHEMA_Bearer,
    6000
);

echo $tokenObject->getType();

### output : Bearer

echo $tokenObject->getExpiresAt()->format('Y-m-d H:i:s');

### output : 2018-12-03 08:05:22

$port = Version::fromString('6.5.0');

echo $port->getMajor();
### output : 6

echo $port->getMinor();
### output : 0

echo $port->getPatch();
### output : 5
```

#### you can find more examples by digging in source.

[](#you-can-find-more-examples-by-digging-in-source)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 79.5% 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 ~26 days

Recently: every ~111 days

Total

25

Last Release

2779d ago

### Community

Maintainers

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

---

Top Contributors

[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (31 commits)")[![majidakbari](https://avatars.githubusercontent.com/u/17963906?v=4)](https://github.com/majidakbari "majidakbari (8 commits)")

---

Tags

value-objectmoneyemailphonevalue objectsversion

### Embed Badge

![Health badge](/badges/mhndev-value-objects/health.svg)

```
[![Health](https://phpackages.com/badges/mhndev-value-objects/health.svg)](https://phpackages.com/packages/mhndev-value-objects)
```

###  Alternatives

[egulias/email-validator

A library for validating emails against several RFCs

11.6k719.7M403](/packages/egulias-email-validator)[sendgrid/sendgrid

This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.

1.5k49.8M183](/packages/sendgrid-sendgrid)[pelago/emogrifier

Converts CSS styles into inline style attributes in your HTML code

94745.9M132](/packages/pelago-emogrifier)[zbateson/mail-mime-parser

MIME email message parser

54651.9M86](/packages/zbateson-mail-mime-parser)[soundasleep/html2text

A PHP script to convert HTML into a plain text format

48020.6M85](/packages/soundasleep-html2text)[opcodesio/mail-parser

Parse emails without the mailparse extension

228.1M9](/packages/opcodesio-mail-parser)

PHPackages © 2026

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