Download the PHP package synthetism/unit-php without Composer
On this page you can find all versions of the php package synthetism/unit-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download synthetism/unit-php
More information about synthetism/unit-php
Files in synthetism/unit-php
Package unit-php
Short Description Unit Architecture for PHP - capability-based, AI-ready components that teach, learn and evolve.
License MIT
Informations about the package unit-php
Unit Architecture — PHP
Capability-based, AI-ready components that teach, learn and evolve.
Unit is a tiny, zero-dependency architecture for PHP 8.1+. A Unit is a
self-contained component with an immutable identity (DNA), immutable state
(props), and a runtime capability trinity (Capabilities + Schema +
Validator). Units can teach capabilities to other units, learn new
ones at runtime, and evolve while preserving lineage.
- Package:
synthetism/unit-php - Namespace:
Unit\ - PHP:
>=8.1— no runtime dependencies
Install
Quick start
A unit keeps all of its state in props and exposes capabilities as plain methods, described to the outside world by a schema.
Teach & learn
Units grow by composition, not inheritance. A unit teaches a contract; any
other unit can learn it. Learned capabilities are namespaced as
unitId.capability, and only native capabilities cascade (no leakage).
Evolve
evolve() returns a new unit with preserved lineage; the original is
untouched.
Events
Design in one line
Identity (DNA) + immutable props + a runtime capability trinity, so components can be composed, introspected, taught to AI agents, and evolved — without a container and without inheritance.
What you get
- Zero dependencies — plain PHP 8.1, portable anywhere.
- Immutable props — one source of truth (
UnitProps::with()returns new). - Capability trinity —
Capabilities,Schema,Validatoras live instances. - Teach / learn — runtime composition, namespaced, leakage-proof.
- Immutable evolution — lineage tracked through
UnitSchema::$parent. - Events — wildcard +
once, injectable emitter. - Result type —
Unit\Resultfor expected failures;Unit\UnitExceptionfor architectural violations. - AI-ready — every schema converts to a provider tool definition
(
Schema::toOpenAiTools()).
Tests
The suite is dependency-free at runtime; the bootstrap registers a PSR-4
autoloader for Unit\ so it can also run from a host project's phpunit binary.
Reference units
src/Examples/ ships two small reference units (SimpleUnit, MathUnit) used
by the tests and useful as templates.
License
MIT.