ManifestSchema
API reference › Scaffold › Manifest › ManifestSchema
Validates a provider manifest and normalises it into typed copy, exclude, modes and merge entries.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
validate() | Validates a raw decoded manifest array and returns the typed structure. | ManifestSchema |
Method details
Section titled “Method details”validate()
Section titled “validate() ”public function validate(mixed[] $raw, bool $inline = false): array{copy: list<array{from: string, to: string}>, exclude: list<string>, modes: array<array-key, PHPForge\Scaffold\Manifest\FileMode>, merge: array<array-key, PHPForge\Scaffold\Merge\MergeStrategyKind>}Validates a raw decoded manifest array and returns the typed structure.
Parameters
| Parameter | Type | Description |
|---|---|---|
$raw | mixed[] | Decoded JSON content of the manifest (or the inline extra.scaffold array). |
$inline | bool | true when $raw is the inline extra.scaffold block, which may also carry the consumer-side keys manifest, allowed-packages and auto. |
Returns
array{copy: list<array{from: string, to: string}>, exclude: list<string>, modes: array<array-key, FileMode>, merge: array<array-key, PHPForge\Scaffold\Merge\MergeStrategyKind>}: Typed manifest with copy[] entries normalised to {from, to} form, modes values resolved to FileMode cases and merge values resolved to MergeStrategyKind cases.
Throws
RuntimeException: when the manifest structure is invalid or contains an unknown key.