Documentation

ExtraPackage
in package

Processing for a composer.json file that will be merged into a RootPackageInterface

Tags
author

Bryan Davis bd808@bd808.com

Table of Contents

$composer  : Composer
$json  : array<string|int, mixed>
$logger  : Logger
$package  : CompletePackage
$path  : string
$versionParser  : VersionParser
__construct()  : mixed
getIncludes()  : array<string|int, mixed>
Get list of additional packages to include if precessing recursively.
getRequires()  : array<string|int, mixed>
Get list of additional packages to require if precessing recursively.
mergeDevInto()  : mixed
Merge just the dev portion into a RootPackageInterface
mergeExtra()  : mixed
Merge extra config into a RootPackageInterface
mergeExtraArray()  : array<string|int, mixed>
Merges two arrays either via arrayMergeDeep or via array_merge.
mergeInto()  : mixed
Merge this package into a RootPackageInterface
mergeScripts()  : mixed
Merge scripts config into a RootPackageInterface
unwrapIfNeeded()  : RootPackageInterface|RootPackage
Get a full featured Package from a RootPackageInterface.
extractReferences()  : array<string|int, mixed>
Extract vcs revision from version constraint (dev-master#abc123.
fixRelativePaths()  : array<string|int, mixed>
Fix a collection of paths that are relative to this package to be relative to the base package.
loadPackage()  : CompletePackage
mergeAutoload()  : mixed
Merge autoload or autoload-dev into a RootPackageInterface
mergeOrDefer()  : array<string|int, mixed>
Merge two collections of package links and collect duplicates for subsequent processing.
mergePackageLinks()  : mixed
Merge package links of the given type into a RootPackageInterface
mergeReferences()  : mixed
Update the root packages reference information.
mergeRequires()  : mixed
Merge require or require-dev into a RootPackageInterface
mergeStabilityFlags()  : mixed
Extract and merge stability flags from the given collection of requires and merge them into a RootPackageInterface
mergeSuggests()  : mixed
Merge suggested packages into a RootPackageInterface
prependRepositories()  : mixed
Add a collection of repositories described by the given configuration to the given package and the global repository manager.
readPackageJson()  : array<string|int, mixed>
Read the contents of a composer.json style file into an array.
replaceSelfVersionDependencies()  : array<string|int, mixed>
Update Links with a 'self.version' constraint with the root package's version.

Properties

Methods

__construct()

public __construct(string $path, Composer $composer, Logger $logger) : mixed
Parameters
$path : string

Path to composer.json file

$composer : Composer
$logger : Logger
Return values
mixed

getIncludes()

Get list of additional packages to include if precessing recursively.

public getIncludes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRequires()

Get list of additional packages to require if precessing recursively.

public getRequires() : array<string|int, mixed>
Return values
array<string|int, mixed>

mergeExtraArray()

Merges two arrays either via arrayMergeDeep or via array_merge.

public static mergeExtraArray(bool $mergeDeep, array<string|int, mixed> $array1, array<string|int, mixed> $array2) : array<string|int, mixed>
Parameters
$mergeDeep : bool
$array1 : array<string|int, mixed>
$array2 : array<string|int, mixed>
Return values
array<string|int, mixed>

unwrapIfNeeded()

Get a full featured Package from a RootPackageInterface.

public static unwrapIfNeeded(RootPackageInterface $root[, string $method = 'setExtra' ]) : RootPackageInterface|RootPackage

In Composer versions before 599ad77 the RootPackageInterface only defines a sub-set of operations needed by composer-merge-plugin and RootAliasPackage only implemented those methods defined by the interface. Most of the unimplemented methods in RootAliasPackage can be worked around because the getter methods that are implemented proxy to the aliased package which we can modify by unwrapping. The exception being modifying the 'conflicts', 'provides' and 'replaces' collections. We have no way to actually modify those collections unfortunately in older versions of Composer.

Parameters
$root : RootPackageInterface
$method : string = 'setExtra'

Method needed

Return values
RootPackageInterface|RootPackage

extractReferences()

Extract vcs revision from version constraint (dev-master#abc123.

protected extractReferences(array<string|int, mixed> $requires, array<string|int, mixed> $references) : array<string|int, mixed>
Parameters
$requires : array<string|int, mixed>
$references : array<string|int, mixed>
Tags
see
RootPackageLoader::extractReferences()
Return values
array<string|int, mixed>

fixRelativePaths()

Fix a collection of paths that are relative to this package to be relative to the base package.

protected fixRelativePaths(array<string|int, mixed> $paths) : array<string|int, mixed>
Parameters
$paths : array<string|int, mixed>
Return values
array<string|int, mixed>

mergeAutoload()

Merge autoload or autoload-dev into a RootPackageInterface

protected mergeAutoload(string $type, RootPackageInterface $root) : mixed
Parameters
$type : string

'autoload' or 'devAutoload'

$root : RootPackageInterface
Return values
mixed

mergeOrDefer()

Merge two collections of package links and collect duplicates for subsequent processing.

protected mergeOrDefer(string $type, array<string|int, mixed> $origin, array<string|int, mixed> $merge, PluginState $state) : array<string|int, mixed>
Parameters
$type : string

'require' or 'require-dev'

$origin : array<string|int, mixed>

Primary collection

$merge : array<string|int, mixed>

Additional collection

$state : PluginState
Return values
array<string|int, mixed>

Merged collection

Merge package links of the given type into a RootPackageInterface

protected mergePackageLinks(string $type, RootPackageInterface $root) : mixed
Parameters
$type : string

'conflict', 'replace' or 'provide'

$root : RootPackageInterface
Return values
mixed

mergeStabilityFlags()

Extract and merge stability flags from the given collection of requires and merge them into a RootPackageInterface

protected mergeStabilityFlags(RootPackageInterface $root, array<string|int, mixed> $requires) : mixed
Parameters
$root : RootPackageInterface
$requires : array<string|int, mixed>
Return values
mixed

prependRepositories()

Add a collection of repositories described by the given configuration to the given package and the global repository manager.

protected prependRepositories(RootPackageInterface $root) : mixed
Parameters
$root : RootPackageInterface
Return values
mixed

readPackageJson()

Read the contents of a composer.json style file into an array.

protected readPackageJson(string $path) : array<string|int, mixed>

The package contents are fixed up to be usable to create a Package object by providing dummy "name" and "version" values if they have not been provided in the file. This is consistent with the default root package loading behavior of Composer.

Parameters
$path : string
Return values
array<string|int, mixed>

replaceSelfVersionDependencies()

Update Links with a 'self.version' constraint with the root package's version.

protected replaceSelfVersionDependencies(string $type, array<string|int, mixed> $links, RootPackageInterface $root) : array<string|int, mixed>
Parameters
$type : string

Link type

$links : array<string|int, mixed>
$root : RootPackageInterface
Return values
array<string|int, mixed>

Search results