PHPackages                             jardisport/foundation - 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. jardisport/foundation

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

jardisport/foundation
=====================

Domain kernel, bounded context, and response interfaces for DDD runtime orchestration

v1.0.0(2mo ago)0431proprietaryPHPPHP &gt;=8.2CI passing

Since Mar 10Pushed 2mo agoCompare

[ Source](https://github.com/jardisPort/foundation)[ Packagist](https://packagist.org/packages/jardisport/foundation)[ Docs](https://github.com/jardisPort/foundation)[ RSS](/packages/jardisport-foundation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (7)Used By (1)

Jardis Foundation Port
======================

[](#jardis-foundation-port)

[![Build Status](https://github.com/jardisPort/foundation/actions/workflows/ci.yml/badge.svg)](https://github.com/jardisPort/foundation/actions/workflows/ci.yml/badge.svg)[![License: PolyForm Shield](https://camo.githubusercontent.com/d8fb46c82be4c5312bf3e372ac734dfdf6a8b328e9c2b2856af671adbb0600a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d506f6c79466f726d253230536869656c642d626c75652e737667)](LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/a68b290dcc313d698dc138a1111aa83eee2f143605449d7e8b5416ea6f88558f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e322d3737374242342e737667)](https://www.php.net/)[![PHPStan Level](https://camo.githubusercontent.com/c51bda247654363d3e30bc352674dd761a9557803a14af0226eb411d6dc0006b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e737667)](phpstan.neon)[![PSR-12](https://camo.githubusercontent.com/34b10db0caa29bacd49bda5c437a8de95385f036f3230b31fa605326e18da22c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f64652532305374796c652d5053522d2d31322d626c75652e737667)](phpcs.xml)

> Part of the **[Jardis Business Platform](https://jardis.io)** — Enterprise-grade PHP components for Domain-Driven Design

DDD runtime contracts — domain kernel, bounded context, context result, and domain response. Four interfaces that define how domains bootstrap infrastructure (cache, database, logger, messaging), how bounded contexts handle requests, how context results transport data through bounded context chains, and how domain responses deliver the final immutable result.

---

Interfaces
----------

[](#interfaces)

All interfaces live in the `JardisPort\Foundation` namespace.

### DomainKernelInterface

[](#domainkernelinterface)

Central service locator providing access to all infrastructure services.

MethodReturn typeDescription`getAppRoot()``string`Returns the application root path`getDomainRoot()``string`Returns the domain root path`getEnv(?string $key)``mixed`Returns a single env value by key, or the full env array if key is null`getFactory()``?FactoryInterface`Returns the factory instance, or null if not configured`getCache()``?CacheInterface`Returns the PSR-16 cache instance, or null if not configured`getConnectionPool()``?ConnectionPoolInterface`Returns the database connection pool, or null if not configured`getLogger()``?LoggerInterface`Returns the PSR-3 logger instance, or null if not configured`getMessage()``?MessagingServiceInterface`Returns the messaging client, or null if not configured### BoundedContextInterface

[](#boundedcontextinterface)

Executes use case handlers within a bounded context.

MethodSignatureDescription`handle``handle(string $className, mixed ...$parameters): mixed`Instantiates and executes a handler class with the given parameters. Returns the handler result or null. Throws `Exception` if execution fails.### ContextResultInterface

[](#contextresultinterface)

Mutable result object for transporting data through bounded context chains. All getter methods return context-keyed arrays for traceability.

MethodSignatureDescription`addData``addData(string $key, mixed $value): self`Add a single data entry`setData``setData(array $data): self`Replace all data at once`getData``getData(): array`Get data keyed by context name`addEvent``addEvent(object $event): self`Add a domain event`getEvents``getEvents(): array`Get domain events keyed by context name`addError``addError(string $message): self`Add an error message`getErrors``getErrors(): array`Get errors keyed by context name`addResult``addResult(ContextResultInterface $result): self`Add a sub-result from a nested bounded context call`getResults``getResults(): array`Get all direct sub-results### DomainResponseInterface

[](#domainresponseinterface)

Immutable final response built by a transformer from ContextResults.

MethodSignatureDescription`getStatus``getStatus(): int`HTTP-style status code of the operation`getData``getData(): array`Aggregated data from all context results, keyed by context name`getEvents``getEvents(): array`All collected domain events, keyed by context name`getErrors``getErrors(): array`All errors, keyed by context name`getMetadata``getMetadata(): array`Response metadata (duration, contexts, timestamp, version)---

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

[](#installation)

```
composer require jardisport/foundation
```

Usage
-----

[](#usage)

```
use JardisPort\Foundation\BoundedContextInterface;
use JardisPort\Foundation\DomainResponseInterface;

class CheckoutController
{
    public function __construct(
        private readonly BoundedContextInterface $context,
    ) {}

    public function checkout(CheckoutRequest $request): DomainResponseInterface
    {
        /** @var DomainResponseInterface $response */
        $response = $this->context->handle(PlaceOrderCommand::class, $request);

        return $response;
    }
}
```

Implemented by
--------------

[](#implemented-by)

- **[jardiscore/foundation](https://github.com/jardisCore/foundation)** — The Jardis runtime platform: DomainKernel, BoundedContext, service integration (cache, database, logger, messaging), and ResourceSharing

Documentation
-------------

[](#documentation)

Full documentation, guides, and API reference:

**[jardis.io/docs/port/foundation](https://jardis.io/docs/port/foundation)**

License
-------

[](#license)

This package is licensed under the [PolyForm Shield License 1.0.0](LICENSE.md). Free for all use except building competing frameworks or developer tooling.

---

**[Jardis](https://jardis.io)** · [Documentation](https://jardis.io/docs) · [Headgent](https://headgent.com)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e07a1b668e9e01ee6d1b85de7b3be1c2513f68aae9494b2011d1592104d5daa0?d=identicon)[jardis](/maintainers/jardis)

---

Top Contributors

[![Headgent](https://avatars.githubusercontent.com/u/245725954?v=4)](https://github.com/Headgent "Headgent (1 commits)")

---

Tags

interfacesfoundationkernelddddomainHeadgentJardisPort

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jardisport-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/jardisport-foundation/health.svg)](https://phpackages.com/packages/jardisport-foundation)
```

###  Alternatives

[ecotone/ecotone

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

558549.8k17](/packages/ecotone-ecotone)[aura/payload

A Domain Payload implementation.

56370.4k9](/packages/aura-payload)[aura/payload-interface

An interface package for Domain Payload implementations.

13392.7k4](/packages/aura-payload-interface)

PHPackages © 2026

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