Search by

johnnickell / fight-common

johnnickell

A shared PHP library for Hexagonal Architecture, CQRS, and reusable domain primitives

Package info

github.com/johnnickell/fight-common

pkg:composer/johnnickell/fight-common

Statistics

Installs: 1 256

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 1

v1.4.1 2026-11-04 18:48 UTC

README

Fight Common: the Inward Port mark beside the Fight Common wordmark

Fight Common

Tests PHP 8.5+ License: MIT

Framework-neutral PHP building blocks for applications that keep business rules independent from frameworks and infrastructure. Fight Common gives experienced PHP teams focused domain primitives, application contracts, and optional adapters without taking ownership of the application around them.

composer require johnnickell/fight-common

Quick Start · Architecture · Component Atlas · Framework Support

Inward architecture

Dependencies point inward: Adapter → Application → Domain.

Layer Owns
Adapter Framework, provider, and infrastructure integration.
Application Use-case coordination and ports expressed against the Domain.
Domain Pure business rules and durable primitives with no framework dependency.

The Architecture guide is authoritative for the complete dependency policy and enforcement model.

Choose a capability

Model Coordinate Connect Operate
Values Messaging HTTP Client Observability
Specifications Validation Cache Process
Event Sourcing Dependency Injection Mail Scheduler
MCP Protocol Semantics

The Repositories guide and the complete Component Atlas hold the implementation detail; this README stays deliberately compact.

JSend response compatibility

Fight Common retains its published 1.x framework-neutral envelope and Symfony response behavior. The Validation guide is the authoritative route for response composition and integration guidance.

MCP foundation imports

Prefer the canonical Application\Mcp\Capability, Protocol, Http and Tool names. The complete migration map explains released-name compatibility; McpResponder and McpDiagnostics stay at root without deprecation.

Execution handlers and read contracts now mirror Domain aggregates directly under Application\Mcp. Concrete inspection Tools live in Adapter\Mcp\Tool\{Session,Phase,Observation,Detail,Notice} and still dispatch through QueryBus; DBAL adapters use Adapter\Mcp\Persistence\{Aggregate}\Dbal. See the aggregate namespace map for direct never-released moves and the unchanged released bridges.

For durable Tasks, inject Domain TaskRepository, the existing TransactionalUnitOfWork and the protected CommittedTaskReader capability separately. The DBAL repository and Task transaction boundary share one dedicated connection; persistence does not own commit. Each Task handler owns its named use case with only its required capabilities; read handlers have no mutation/transaction dependencies.

Project routes

Copyright © 2026 John Nickell.

See local Docker, worktree and build-cache operations for explicit main/worktree selection, guarded teardown and fresh versus reused gate evidence.