Skip to content
docsv0.2.0

ContractManifest

Describes one architectural contract: its `id` and `version` (a two-part contract version such as `0.1`), the capabilities it requires/provides/suggests, its surface requirements, and optional links to the contract's Academy unit and migration guide. A pure value object: {@see fromArray()} validates, {@see toArray()} serializes deterministically. `adapterRequirements` is deliberately NOT modelled in slice 1: the resolver does not yet resolve adapters, and a field the engine never reads is decorative metadata (spec §25 anti-pattern 5). It returns as a typed field when adapter resolution lands (ROADMAP P10).

ContractManifest::__construct()

public function __construct(string $id, string $version, array $requiresCapabilities = [], array $providesCapabilities = [], array $suggestsCapabilities = [], array $surfaceRequirements = [], ?string $academyUrl = null, ?string $migrationUrl = null):

Parameters

Parameters of __construct()
NameTypeDescription
$idstring
$versionstring
$requiresCapabilitieslist<string>
$providesCapabilitieslist<string>
$suggestsCapabilitieslist<string>
$surfaceRequirementslist<string>
$academyUrl?string
$migrationUrl?string

ContractManifest::fromArray()

public static function fromArray(array $data): self

Build a contract manifest from a decoded array, validating `id` (non-empty) and `version` (a valid — possibly two-part — version).

Parameters

Parameters of fromArray()
NameTypeDescription
$dataarray<string, mixed>

Throws

InvalidManifestException On a missing/empty required field or an invalid version.

ContractManifest::toArray()

public function toArray(): array

Serialize to an array with a fixed, deterministic key order.