johnnickell / fight-common
A shared PHP library for Hexagonal Architecture, CQRS, and reusable domain primitives
Requires
- php: >=8.5
- psr/cache: ^3.0
- psr/container: ^2.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^3.0
Requires (Dev)
- codeigniter4/framework: ^4.7
- codeigniter4/queue: ^1.0
- deptrac/deptrac: ^4.7
- doctrine/dbal: ^4.4
- doctrine/orm: ^3.6
- dragonmantank/cron-expression: ^3.0
- guzzlehttp/guzzle: ^7.10
- guzzlehttp/promises: ^2.3
- guzzlehttp/psr7: ^2.9
- laravel/framework: ^13.0
- lcobucci/jwt: ^5.6
- league/flysystem: ^3.0
- mockery/mockery: ^1.6
- nikic/php-parser: ^5.8
- phpseclib/phpseclib: ^3.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- psr/simple-cache: ^3.0
- rector/rector: ^2.4
- slevomat/coding-standard: ^8.27
- slim/slim: ^4.14
- squizlabs/php_codesniffer: ^4.0
- symfony/dependency-injection: ^8.1
- symfony/event-dispatcher: ^8.1
- symfony/filesystem: ^8.1
- symfony/finder: ^8.1
- symfony/http-foundation: ^8.1
- symfony/http-kernel: ^8.1
- symfony/mailer: ^8.1
- symfony/mercure: ^0.7
- symfony/messenger: ^8.1
- symfony/process: ^8.1
- symfony/routing: ^8.1
- symfony/yaml: ^8.1
- twig/twig: ^3.0
- twilio/sdk: ^8.0
- yiisoft/db: ^2.0
- yiisoft/db-sqlite: ^2.0
- yiisoft/di: ^1.4
- yiisoft/files: ^2.0
- yiisoft/mailer: ^6.1
- yiisoft/router: ^4.0
- yiisoft/router-fastroute: ^4.0
- yiisoft/view: ^12.2
Suggests
- ext-sodium: Required by the optional Sodium MCP ordinary interaction state protector
- codeigniter4/framework: Required by the CodeIgniter transaction and capability service delegates
- codeigniter4/queue: Required by the CodeIgniter Queue messaging adapters
- deptrac/deptrac: Required to run optional architecture checks in a consuming repository
- doctrine/dbal: Required by the custom doctrine data types
- doctrine/orm: Required by the canonical Doctrine transactional unit of work, legacy 1.x unit of work, audit repository, and base repository
- dragonmantank/cron-expression: Required by the Scheduler for cron expression parsing
- guzzlehttp/guzzle: Required by the guzzle http client adapter
- guzzlehttp/promises: Required by the guzzle http client adapter
- guzzlehttp/psr7: Required by the guzzle http client adapter
- laravel/framework: Required by the Laravel cache, queue, transaction, security, routing, and capability provider adapters
- lcobucci/jwt: Required by the jwt token encoder and decoder
- league/flysystem: Required by the flysystem file storage adapter
- phpseclib/phpseclib: Required by the SFTP file transport adapter
- psr/simple-cache: Required by the optional PSR-16 read-through cache adapter
- slevomat/coding-standard: Required by the optional FightCommon PHP_CodeSniffer standard
- slim/slim: Required by the Slim HTTP and middleware adapter prototypes
- squizlabs/php_codesniffer: Required to run the optional FightCommon PHP_CodeSniffer standard
- symfony/dependency-injection: Required by the Symfony compilation passes
- symfony/event-dispatcher: Required by the validation and other event subscribers
- symfony/filesystem: Required for the filesystem adapter
- symfony/http-foundation: Required for the JSend response and other HTTP related utilities
- symfony/http-kernel: Required for the kernel middleware and other HTTP related utilities
- symfony/mailer: Required by the Symfony mail transport and attachment adapters
- symfony/mercure: Required by the public and private Mercure hub publishers
- symfony/messenger: Required by the async messenger command bus and event dispatcher
- symfony/process: Required by the Symfony process runner adapter
- symfony/routing: Required for the URL generator
- symfony/yaml: Required by the optional bounded MCP Skill frontmatter parser (8.1 or later)
- twig/twig: Required by the Twig template engine adapter
- twilio/sdk: Required by the Twilio SMS transport adapter
- yiisoft/db: Required by the Yii DB transactional unit of work adapter
- yiisoft/db-sqlite: Required to run the Yii DB transactional unit of work adapter conformance tests
- yiisoft/di: Required to boot Yii capability service providers
- yiisoft/files: Required to evaluate Yii Files against the shared Fight filesystem conformance suite
- yiisoft/mailer: Required to evaluate Yii Mail against the shared Fight mail conformance suite
- yiisoft/router: Required by the Yii URL generator adapter
- yiisoft/router-fastroute: Required to run the Yii URL generator adapter conformance tests
- yiisoft/view: Required to evaluate Yii View against the shared Fight templating conformance suite
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 1.4.x-dev
- v1.4.1
- v1.4.0
- 1.3.x-dev
- v1.3.0
- 1.2.x-dev
- v1.2.0
- 1.1.x-dev
- 1.1.0
- 1.0.x-dev
- 1.0.0
- dev-feature/task-00194-event-store-table-names
- dev-feature/task-00204-subscriber-inspection-clock
- dev-merge/1.4.1-main-to-develop
- dev-feature/task-00191-mcp-aggregate-adapter-namespaces
- dev-main
- dev-patch/1.4.1-main-forward-port
- dev-patch/1.4.1-laravel-terminal-fallback
- dev-feature/task-00189-task-values
- dev-feature/task-00190-evidence-domain-values
- dev-feature/task-00188-task-disclosure-projection
- dev-planning/epic-00013-table-names
This package is auto-updated.
Last update: 2026-11-05 05:08:45 UTC
README
Fight Common
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 | 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
- Read the documentation or begin with the Quick Start.
- Check supported integration paths in Framework Support.
- See how to contribute.
- Browse the repository, source, and changelog.
- Fight Common is available under the MIT License.
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.