PHPackages                             domain-engine/library - 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. domain-engine/library

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

domain-engine/library
=====================

A framework agnostic structure providing domain concepts specifications

00PHP

Since Apr 3Pushed 1mo agoCompare

[ Source](https://github.com/domain-engine/library)[ Packagist](https://packagist.org/packages/domain-engine/library)[ RSS](/packages/domain-engine-library/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DomainEngine Library
====================

[](#domainengine-library)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/e2df0db5111cc996698331f261bf2635d5d982b997163dd61bcd20b2f000f216/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d3838393242462e737667)](https://www.php.net/)

A lightweight PHP library providing essential building blocks for Domain-Driven Design (DDD) applications.

Features
--------

[](#features)

- **Value Objects**: Base implementation for immutable value objects
- **Domain Events**: Foundation for domain event handling
- **Aggregate Root**: Base class for aggregate roots in domain models

---

- **Commands**: Base command pattern implementation
- **Process manager**: in development

---

- **Query**: in development
- **Read model**: in development

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Composer

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

[](#installation)

```
composer require domain-engine/library
```

Usage
-----

[](#usage)

### Value Objects

[](#value-objects)

```
use DomainEngine\Library\Value\StringValue;

class Email extends StringValue
{
    protected static function from(string $value): self
    {
        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
            throw new \InvalidArgumentException("Invalid email address");
        }
    }
}
```

### Domain Events

[](#domain-events)

```
use DomainEngine\Library\Domain\DomainEvent;

class UserRegistered extends DomainEvent
{
    public function __construct(
        private string $userId,
        private string $email
    ) {
    }
}
```

### Commands

[](#commands)

```
use DomainEngine\Library\Application\Command;

class RegisterUserCommand extends Command
{
    public function __construct(
        public readonly string $email,
        public readonly string $password
    ) {}
}
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request, feedback or Idea.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e43979fd0caa674c9bf7b62a91f2014913e268cd479b44ed3abaa688538e478c?d=identicon)[Peter Brecska](/maintainers/Peter%20Brecska)

---

Top Contributors

[![pepies](https://avatars.githubusercontent.com/u/3463955?v=4)](https://github.com/pepies "pepies (8 commits)")

### Embed Badge

![Health badge](/badges/domain-engine-library/health.svg)

```
[![Health](https://phpackages.com/badges/domain-engine-library/health.svg)](https://phpackages.com/packages/domain-engine-library)
```

###  Alternatives

[semperfiwebdesign/all-in-one-seo-pack

All in One SEO Pack plugin for WordPress SEO

3632.1k](/packages/semperfiwebdesign-all-in-one-seo-pack)[jedkirby/tweet-entity-linker

Convert Twitter API Tweet entities such as URLs, Hashtags and User Mentions into their respective HTML entities.

102.7k](/packages/jedkirby-tweet-entity-linker)[frictionlessdata/datapackage

A utility library for working with Data Packages

102.6k1](/packages/frictionlessdata-datapackage)

PHPackages © 2026

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