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.
composer require milpa/core- PHP ≥ 8.3
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| 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.
Full API reference: getmilpa.github.io/core — generated straight from the source DocBlocks and dressed with the Milpa design system.
Contributions are welcome — see CONTRIBUTING.md. Please report security issues via SECURITY.md, and note that this project follows a Code of Conduct.
Apache-2.0 © the Milpa authors.