Composer API
Class

Composer\Package\Loader\ArrayLoader

class ArrayLoader implements LoaderInterface

Methods

__construct(VersionParser $parser = null, $loadOptions = false)

PackageInterface load(array $config, string $class = 'Composer\\Package\\CompletePackage')

Converts a package from an array to a real instance

Link[] parseLinks(string $source, string $sourceVersion, string $description, array $links)

string|null getBranchAlias(array $config)

Retrieves a branch alias (dev-master => 1.0.x-dev for example) if it exists

Details

at line 32
public __construct(VersionParser $parser = null, $loadOptions = false)

Parameters

VersionParser $parser
$loadOptions

at line 41
public PackageInterface load(array $config, string $class = 'Composer\\Package\\CompletePackage')

Converts a package from an array to a real instance

Parameters

array $config
string $class Package class to use

Return Value

PackageInterface

Parameters

string $source source package name
string $sourceVersion source package version (pretty version ideally)
string $description link description (e.g. requires, replaces, ..)
array $links array of package name => constraint mappings

Return Value

Link[]

at line 256
public string|null getBranchAlias(array $config)

Retrieves a branch alias (dev-master => 1.0.x-dev for example) if it exists

Parameters

array $config the entire package config

Return Value

string|null normalized version of the branch alias or null if there is none