CapabilitySuggestion
A `suggests` capability record — an OPTIONAL dependency. A missing suggested capability MUST NOT fail boot; `fallback` names the graceful-degradation path (e.g. "noop" / a null-object strategy). Legacy bare-FQCN declarations are accepted via {@see fromInterface()}.
CapabilitySuggestion::__construct()
public function __construct(string $id, string $interface, string $constraint = '*', ?string $fallback = null):Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $id | string | |
| $interface | string | |
| $constraint | string | |
| $fallback | ?string |
CapabilitySuggestion::fromArray()
public static function fromArray(array $record): selfBuild a suggestion record from a decoded `suggests` manifest entry, validating `id` and `interface`, defaulting `constraint` to `*`, and normalizing an empty `fallback` to null.
Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $record | array<string, mixed> |
Throws
\InvalidArgumentException If `id` or `interface` is empty.
CapabilitySuggestion::fromInterface()
public static function fromInterface(string $interface): selfWrap a legacy bare-FQCN declaration as an any-version suggestion.
Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $interface | string |
CapabilitySuggestion::parse()
public static function parse(array|string $record): selfParse a `suggests` manifest entry in either the legacy bare-FQCN string form or the structured-record array form, dispatching to {@see fromInterface()} or {@see fromArray()}.
Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $record | (string | array<string, mixed>) |