milpa / core
Milpa Framework — core contracts and primitives. Framework-agnostic: no ORM, no HTTP client, no host-application coupling (ADR-001).
Requires
- php: >=8.3
- psr/container: ^2.0
- symfony/event-dispatcher-contracts: ^3.0
Requires (Dev)
- phpstan/phpdoc-parser: ^2.3
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2026-07-05 13:00:15 UTC
README
The framework-agnostic core of Milpa — a modular, AI-native PHP framework. Siembra módulos, cosecha aplicaciones.
milpa/core is the dependency-light heart of the Milpa framework: the attributes,
events, value objects, enums, interfaces, and the verification seam that every Milpa
module builds on. No Doctrine, no HTTP client, no product coupling — just the
contracts and primitives, so you can depend on them from anywhere.
Install
composer require milpa/core
Requirements
- PHP ≥ 8.3
Quick example
Value objects are immutable and self-validating. For instance, SemanticVersion:
use Milpa\app\ValueObjects\SemanticVersion; $v = SemanticVersion::parse('2.4.1'); $v->satisfies('^2.0'); // true $v->greaterThan(SemanticVersion::parse('2.4.0')); // true $v->incrementMinor(); // 2.5.0 (a new instance) $v->isStable(); // true — no pre-release tag
What's inside
| Namespace | What it provides |
|---|---|
Milpa\app\Attributes |
Declarative attributes (RegisterService, BusinessRule, Subscribe, …) |
Milpa\app\Events |
Framework event contracts + dispatch primitives |
Milpa\app\ValueObjects |
Immutable, validated values (SemanticVersion, capability & verification VOs, …) |
Milpa\app\Enums |
Shared enums (Roles, Events, …) |
Milpa\app\Interfaces |
Core contracts (MilpaEventDispatcherInterface, PluginManifestInterface, …) |
Milpa\app\Support |
Small framework-agnostic helpers |
Every public symbol carries a DocBlock — the API reference is generated straight from them.
Documentation
Full API reference: getmilpa.github.io/core — generated straight from the source DocBlocks and dressed with the Milpa design system.
Contributing
Contributions are welcome — see CONTRIBUTING.md. Please report security issues via SECURITY.md, and note that this project follows a Code of Conduct.
License
Apache-2.0 © the Milpa authors.