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): selfCreate a manifest from a milpa.json file path.
Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $manifestPath | string |
PluginManifestInterface::getName()
abstract public function getName(): stringVendor/package name (e.g., "acme/mail-plugin").
PluginManifestInterface::getDisplayName()
abstract public function getDisplayName(): stringHuman-readable display name (e.g., "Mail Plugin").
PluginManifestInterface::getDescription()
abstract public function getDescription(): stringShort human-readable summary of what the plugin does.
PluginManifestInterface::getVersion()
abstract public function getVersion(): Milpa\app\ValueObjects\SemanticVersionThe plugin's parsed semantic version.
PluginManifestInterface::getType()
abstract public function getType(): stringPlugin type: Web, CLI, Mixed, Service.
PluginManifestInterface::getNamespace()
abstract public function getNamespace(): stringPHP namespace (e.g., "Acme\Plugins\ExamplePlugin").
PluginManifestInterface::getEntrypoint()
abstract public function getEntrypoint(): stringMain plugin file relative to plugin directory (e.g., "ExamplePlugin.php").
PluginManifestInterface::getProvides()
abstract public function getProvides(): arrayThe interfaces/services this plugin provides to the capability system.
Returns
Interfaces/services this plugin provides
PluginManifestInterface::getRequires()
abstract public function getRequires(): arrayThe interfaces/services this plugin cannot boot without.
Returns
Required interfaces/services (hard dependency)
PluginManifestInterface::getSuggests()
abstract public function getSuggests(): arrayThe 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(): arrayThe `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(): arrayThe `requires` capabilities as typed records (hard dependencies).
PluginManifestInterface::getSuggestedCapabilities()
abstract public function getSuggestedCapabilities(): arrayThe `suggests` capabilities as typed records (soft dependencies with an optional fallback).
PluginManifestInterface::getComposerDependencies()
abstract public function getComposerDependencies(): arrayComposer packages this plugin depends on, beyond the framework itself.
Returns
Package => constraint (e.g., "symfony/mailer" => "^7.0")
PluginManifestInterface::getPluginDependencies()
abstract public function getPluginDependencies(): arrayOther Milpa plugins this plugin depends on.
Returns
Plugin name => constraint (e.g., "acme/example-plugin" => "^2.0")
PluginManifestInterface::getMinMilpaVersion()
abstract public function getMinMilpaVersion(): ?stringThe minimum Milpa/Milpa framework version this plugin requires, or null if unconstrained.
PluginManifestInterface::getPhpVersion()
abstract public function getPhpVersion(): ?stringThe PHP version constraint this plugin requires (e.g. ">=8.2"), or null if unconstrained.
PluginManifestInterface::getEnvVars()
abstract public function getEnvVars(): arrayEnvironment variable names the plugin expects to be set.
Returns
Required environment variables
PluginManifestInterface::getMigrationsDirectory()
abstract public function getMigrationsDirectory(): ?stringMigrations directory name relative to plugin root (e.g., "Migrations").
PluginManifestInterface::getAuthors()
abstract public function getAuthors(): arrayThe plugin's declared authors.
Returns
Author list with name/email
PluginManifestInterface::toMetadataArray()
abstract public function toMetadataArray(): arrayConvert 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(): voidValidate the manifest. Throws on invalid data.
Throws
\InvalidArgumentException If required fields are missing or invalid
PluginManifestInterface::getRawData()
abstract public function getRawData(): arrayGet the raw manifest data array.