ExtraPackage
in package
Processing for a composer.json file that will be merged into a RootPackageInterface
Tags
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
$composer
protected
Composer
$composer
$json
protected
array<string|int, mixed>
$json
$logger
protected
Logger
$logger
$package
protected
CompletePackage
$package
$path
protected
string
$path
$versionParser
protected
VersionParser
$versionParser
Methods
__construct()
public
__construct(string $path, Composer $composer, Logger $logger) : mixed
Parameters
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> —mergeDevInto()
Merge just the dev portion into a RootPackageInterface
public
mergeDevInto(RootPackageInterface $root, PluginState $state) : mixed
Parameters
- $root : RootPackageInterface
- $state : PluginState
Return values
mixed —mergeExtra()
Merge extra config into a RootPackageInterface
public
mergeExtra(RootPackageInterface $root, PluginState $state) : mixed
Parameters
- $root : RootPackageInterface
- $state : PluginState
Return values
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> —mergeInto()
Merge this package into a RootPackageInterface
public
mergeInto(RootPackageInterface $root, PluginState $state) : mixed
Parameters
- $root : RootPackageInterface
- $state : PluginState
Return values
mixed —mergeScripts()
Merge scripts config into a RootPackageInterface
public
mergeScripts(RootPackageInterface $root, PluginState $state) : mixed
Parameters
- $root : RootPackageInterface
- $state : PluginState
Return values
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
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> —loadPackage()
protected
loadPackage(array<string|int, mixed> $json) : CompletePackage
Parameters
- $json : array<string|int, mixed>
Return values
CompletePackage —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
mergePackageLinks()
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 —mergeReferences()
Update the root packages reference information.
protected
mergeReferences(RootPackageInterface $root) : mixed
Parameters
- $root : RootPackageInterface
Return values
mixed —mergeRequires()
Merge require or require-dev into a RootPackageInterface
protected
mergeRequires(string $type, RootPackageInterface $root, PluginState $state) : mixed
Parameters
- $type : string
-
'require' or 'require-dev'
- $root : RootPackageInterface
- $state : PluginState
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 —mergeSuggests()
Merge suggested packages into a RootPackageInterface
protected
mergeSuggests(RootPackageInterface $root) : mixed
Parameters
- $root : RootPackageInterface
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