Skip to content
PHP Ecosystem
Explore

ManifestSchema

API reference › Scaffold › Manifest › ManifestSchema

final classPHPForge\Scaffold\Manifest\ManifestSchema
Sourcesrc/Manifest/ManifestSchema.php

Validates a provider manifest and normalises it into typed copy, exclude, modes and merge entries.

MethodDescriptionDefined by
validate()Validates a raw decoded manifest array and returns the typed structure.ManifestSchema
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

ParameterTypeDescription
$rawmixed[]Decoded JSON content of the manifest (or the inline extra.scaffold array).
$inlinebooltrue 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.