PHPackages                             afpinedac/common-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. afpinedac/common-value-objects

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

afpinedac/common-value-objects
==============================

A collection of reusable value objects for PHP

01PHP

Since Feb 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/afpinedac/CommonValueObjects)[ Packagist](https://packagist.org/packages/afpinedac/common-value-objects)[ RSS](/packages/afpinedac-common-value-objects/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CommonValueObjects
==================

[](#commonvalueobjects)

**CommonValueObjects** is a PHP package that provides a collection of reusable Value Objects for common data types, ensuring immutability, validation, and consistency in your applications.

---

📌 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require afpinedac/common-value-objects
```

---

🚀 Features
----------

[](#-features)

- ✅ Immutable Value Objects for safer data handling.
- ✅ Strict Validation to prevent invalid values.
- ✅ PSR-4 Autoloading for seamless integration.
- ✅ Compatible with PHP 8+.

---

📂 Available Value Objects
-------------------------

[](#-available-value-objects)

**Class****Description****Percentage**Represents a percentage value (e.g., 25%)**URL**Represents a valid URL**Email**Represents a valid Email**File**Represents a File---

🛠 Usage
-------

[](#-usage)

### Example: Using `Percentage`

[](#example-using-percentage)

```
use Afpinedac\CommonValueObjects\Numeric\Percentage;

$percentage = new Percentage(0.25);
echo $percentage->getFormatted(); // Output: 25.00%
```

### Example: Using `Latitude`

[](#example-using-latitude)

```
use Afpinedac\CommonValueObjects\Geographic\Latitude;

$latitude = new Latitude(40.7128);
echo $latitude; // Output: 40.7128
```

---

✅ Running Tests
---------------

[](#-running-tests)

This package uses **PestPHP** for testing. To run tests, use:

```
vendor/bin/pest
```

---

📜 License
---------

[](#-license)

This package is released under the **MIT License**.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Feel free to submit pull requests or open issues on GitHub.

---

📬 Contact
---------

[](#-contact)

For questions or feature requests, contact **\[Your Name\]** at ****.

---

🚀 Start using `CommonValueObjects` today to improve data consistency in your PHP projects!

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2547359ee941a57a0551b7d3acfe5f4bd3fc6b24506de2240f38086972703873?d=identicon)[afpinedac](/maintainers/afpinedac)

### Embed Badge

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

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

PHPackages © 2026

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