Skip to content
docsv0.13.1

DependencyResolver

Resolves plugin and Composer dependencies before installation. Checks: - Plugin dependencies (dependencies.plugins in milpa.json) - Composer packages (dependencies.composer in milpa.json) - Capability requirements (canonical `capabilities.requires` records or legacy `contracts.requires` bare FQCNs — both shapes, via the manifest's typed readers)

DependencyResolver::__construct()

public function __construct(string $rootPath):

Parameters

Parameters of __construct()
NameTypeDescription
$rootPathstring

DependencyResolver::resolve()

public function resolve(Milpa\Plugin\PluginManifest $manifest, array $installedPlugins): Milpa\DTO\DependencyResolution

Resolve all dependencies for a plugin to be installed. Capability matching is by IDENTITY: an installed provision satisfies a requirement when its capability id or its interface equals the requirement's `id`, `interface`, or any `oneOf` alternative — the same one-directional superset posture core's CapabilityGraphChecker takes (an install preview must not fail a graph the resolver would close via the interface bridge or `oneOf`). Legacy bare-FQCN declarations on either side behave exactly as before: the FQCN is both id and interface.

Parameters

Parameters of resolve()
NameTypeDescription
$manifestPluginManifestThe plugin to install
$installedPluginsarray<array{name: string, version?: string, provides?: array<int, (string | array<string, mixed>)>, requires?: array<string>}>

DependencyResolver::checkComposerDeps()

public function checkComposerDeps(array $requiredPackages): array

Check Composer dependencies against what's currently installed. Reads root composer.lock to check installed versions.

Parameters

Parameters of checkComposerDeps()
NameTypeDescription
$requiredPackagesarray<string, string>Package => constraint

Returns

Packages that need to be installed (package => constraint)