Skip to content
docs

PluginManifestInterface

Read-only accessor for a plugin's `milpa.json` manifest: identity, versioning, capability contracts ({@see getProvides()}, {@see getRequires()}, {@see getSuggests()}), and dependency/environment requirements. This is the primary source of plugin metadata when a manifest file exists; plugins without one fall back to `#[PluginMetadata]` attributes.

PluginManifestInterface::fromPath()

abstract public static function fromPath(string $manifestPath): self

Create a manifest from a milpa.json file path.

Parameters

Parámetros de fromPath()
NombreTipoDescripción
$manifestPathstring

PluginManifestInterface::getName()

abstract public function getName(): string

Vendor/package name (e.g., "acme/mail-plugin").

PluginManifestInterface::getDisplayName()

abstract public function getDisplayName(): string

Human-readable display name (e.g., "Mail Plugin").

PluginManifestInterface::getDescription()

abstract public function getDescription(): string

Short human-readable summary of what the plugin does.

PluginManifestInterface::getVersion()

abstract public function getVersion(): Milpa\app\ValueObjects\SemanticVersion

The plugin's parsed semantic version.

PluginManifestInterface::getType()

abstract public function getType(): string

Plugin type: Web, CLI, Mixed, Service.

PluginManifestInterface::getNamespace()

abstract public function getNamespace(): string

PHP namespace (e.g., "Acme\Plugins\ExamplePlugin").

PluginManifestInterface::getEntrypoint()

abstract public function getEntrypoint(): string

Main plugin file relative to plugin directory (e.g., "ExamplePlugin.php").

PluginManifestInterface::getProvides()

abstract public function getProvides(): array

The interfaces/services this plugin provides to the capability system.

Returns

Interfaces/services this plugin provides

PluginManifestInterface::getRequires()

abstract public function getRequires(): array

The interfaces/services this plugin cannot boot without.

Returns

Required interfaces/services (hard dependency)

PluginManifestInterface::getSuggests()

abstract public function getSuggests(): array

The interfaces/services this plugin can use if available but does not strictly need.

Returns

Optional interfaces/services (soft dependency)

PluginManifestInterface::getProvidedCapabilities()

abstract public function getProvidedCapabilities(): array

The `provides` capabilities as typed records (id, interface, constraint), parsed from the canonical `capabilities.provides` key. Prefer this over {@see getProvides()} — it exposes the validated value objects rather than bare class-strings.

PluginManifestInterface::getRequiredCapabilities()

abstract public function getRequiredCapabilities(): array

The `requires` capabilities as typed records (hard dependencies).

PluginManifestInterface::getSuggestedCapabilities()

abstract public function getSuggestedCapabilities(): array

The `suggests` capabilities as typed records (soft dependencies with an optional fallback).

PluginManifestInterface::getComposerDependencies()

abstract public function getComposerDependencies(): array

Composer packages this plugin depends on, beyond the framework itself.

Returns

Package => constraint (e.g., "symfony/mailer" => "^7.0")

PluginManifestInterface::getPluginDependencies()

abstract public function getPluginDependencies(): array

Other Milpa plugins this plugin depends on.

Returns

Plugin name => constraint (e.g., "acme/example-plugin" => "^2.0")

PluginManifestInterface::getMinMilpaVersion()

abstract public function getMinMilpaVersion(): ?string

The minimum Milpa/Milpa framework version this plugin requires, or null if unconstrained.

PluginManifestInterface::getPhpVersion()

abstract public function getPhpVersion(): ?string

The PHP version constraint this plugin requires (e.g. ">=8.2"), or null if unconstrained.

PluginManifestInterface::getEnvVars()

abstract public function getEnvVars(): array

Environment variable names the plugin expects to be set.

Returns

Required environment variables

PluginManifestInterface::getMigrationsDirectory()

abstract public function getMigrationsDirectory(): ?string

Migrations directory name relative to plugin root (e.g., "Migrations").

PluginManifestInterface::getAuthors()

abstract public function getAuthors(): array

The plugin's declared authors.

Returns

Author list with name/email

PluginManifestInterface::toMetadataArray()

abstract public function toMetadataArray(): array

Convert to the legacy metadata-array shape (`Plugins::$plugins`) that some consumers still read instead of the typed accessors above.

PluginManifestInterface::validate()

abstract public function validate(): void

Validate the manifest. Throws on invalid data.

Throws

\InvalidArgumentException If required fields are missing or invalid

PluginManifestInterface::getRawData()

abstract public function getRawData(): array

Get the raw manifest data array.