PHP Class Wikimedia\Composer\Merge\ExtraPackage

Author: Bryan Davis ([email protected])
Afficher le fichier Open project: wikimedia/composer-merge-plugin Class Usage Examples

Protected Properties

Свойство Type Description
$composer Composer\Composer
$json array
$logger Wikimedia\Composer\Logger
$package Composer\Package\CompletePackage
$path string
$versionParser Composer\Package\Version\VersionParser

Méthodes publiques

Méthode Description
__construct ( string $path, Composer\Composer $composer, Wikimedia\Composer\Logger $logger )
getIncludes ( ) : array Get list of additional packages to include if precessing recursively.
getRequires ( ) : array Get list of additional packages to require if precessing recursively.
mergeDevInto ( Composer\Package\RootPackageInterface $root, PluginState $state ) Merge just the dev portion into a RootPackageInterface
mergeExtra ( Composer\Package\RootPackageInterface $root, PluginState $state ) Merge extra config into a RootPackageInterface
mergeExtraArray ( boolean $mergeDeep, array $array1, array $array2 ) : array Merges two arrays either via arrayMergeDeep or via array_merge.
mergeInto ( Composer\Package\RootPackageInterface $root, PluginState $state ) Merge this package into a RootPackageInterface
unwrapIfNeeded ( Composer\Package\RootPackageInterface $root, string $method = 'setExtra' ) : Composer\Package\RootPackageInterface | Composer\Package\RootPackage Get a full featured Package from a RootPackageInterface.

Méthodes protégées

Méthode Description
extractReferences ( array $requires, array $references ) : array Extract vcs revision from version constraint (dev-master#abc123.
fixRelativePaths ( array $paths ) : array Fix a collection of paths that are relative to this package to be relative to the base package.
loadPackage ( array $json ) : Composer\Package\CompletePackage
mergeAutoload ( string $type, Composer\Package\RootPackageInterface $root ) Merge autoload or autoload-dev into a RootPackageInterface
mergeOrDefer ( string $type, array $origin, array $merge, PluginState $state ) : array Merge two collections of package links and collect duplicates for subsequent processing.
mergePackageLinks ( string $type, Composer\Package\RootPackageInterface $root ) Merge package links of the given type into a RootPackageInterface
mergeReferences ( Composer\Package\RootPackageInterface $root ) Update the root packages reference information.
mergeRequires ( string $type, Composer\Package\RootPackageInterface $root, PluginState $state ) Merge require or require-dev into a RootPackageInterface
mergeStabilityFlags ( Composer\Package\RootPackageInterface $root, array $requires ) Extract and merge stability flags from the given collection of requires and merge them into a RootPackageInterface
mergeSuggests ( Composer\Package\RootPackageInterface $root ) Merge suggested packages into a RootPackageInterface
prependRepositories ( Composer\Package\RootPackageInterface $root ) Add a collection of repositories described by the given configuration to the given package and the global repository manager.
readPackageJson ( string $path ) : array Read the contents of a composer.json style file into an array.
replaceSelfVersionDependencies ( string $type, array $links, Composer\Package\RootPackageInterface $root ) : array Update Links with a 'self.version' constraint with the root package's version.

Method Details

__construct() public méthode

public __construct ( string $path, Composer\Composer $composer, Wikimedia\Composer\Logger $logger )
$path string Path to composer.json file
$composer Composer\Composer
$logger Wikimedia\Composer\Logger

extractReferences() protected méthode

Extract vcs revision from version constraint (dev-master#abc123.
See also: RootPackageLoader::extractReferences()
protected extractReferences ( array $requires, array $references ) : array
$requires array
$references array
Résultat array

fixRelativePaths() protected méthode

Fix a collection of paths that are relative to this package to be relative to the base package.
protected fixRelativePaths ( array $paths ) : array
$paths array
Résultat array

getIncludes() public méthode

Get list of additional packages to include if precessing recursively.
public getIncludes ( ) : array
Résultat array

getRequires() public méthode

Get list of additional packages to require if precessing recursively.
public getRequires ( ) : array
Résultat array

loadPackage() protected méthode

protected loadPackage ( array $json ) : Composer\Package\CompletePackage
$json array
Résultat Composer\Package\CompletePackage

mergeAutoload() protected méthode

Merge autoload or autoload-dev into a RootPackageInterface
protected mergeAutoload ( string $type, Composer\Package\RootPackageInterface $root )
$type string 'autoload' or 'devAutoload'
$root Composer\Package\RootPackageInterface

mergeDevInto() public méthode

Merge just the dev portion into a RootPackageInterface
public mergeDevInto ( Composer\Package\RootPackageInterface $root, PluginState $state )
$root Composer\Package\RootPackageInterface
$state PluginState

mergeExtra() public méthode

Merge extra config into a RootPackageInterface
public mergeExtra ( Composer\Package\RootPackageInterface $root, PluginState $state )
$root Composer\Package\RootPackageInterface
$state PluginState

mergeExtraArray() public static méthode

Merges two arrays either via arrayMergeDeep or via array_merge.
public static mergeExtraArray ( boolean $mergeDeep, array $array1, array $array2 ) : array
$mergeDeep boolean
$array1 array
$array2 array
Résultat array

mergeInto() public méthode

Merge this package into a RootPackageInterface
public mergeInto ( Composer\Package\RootPackageInterface $root, PluginState $state )
$root Composer\Package\RootPackageInterface
$state PluginState

mergeOrDefer() protected méthode

Merge two collections of package links and collect duplicates for subsequent processing.
protected mergeOrDefer ( string $type, array $origin, array $merge, PluginState $state ) : array
$type string 'require' or 'require-dev'
$origin array Primary collection
$merge array Additional collection
$state PluginState
Résultat array Merged collection

mergeReferences() protected méthode

Update the root packages reference information.
protected mergeReferences ( Composer\Package\RootPackageInterface $root )
$root Composer\Package\RootPackageInterface

mergeRequires() protected méthode

Merge require or require-dev into a RootPackageInterface
protected mergeRequires ( string $type, Composer\Package\RootPackageInterface $root, PluginState $state )
$type string 'require' or 'require-dev'
$root Composer\Package\RootPackageInterface
$state PluginState

mergeStabilityFlags() protected méthode

Extract and merge stability flags from the given collection of requires and merge them into a RootPackageInterface
protected mergeStabilityFlags ( Composer\Package\RootPackageInterface $root, array $requires )
$root Composer\Package\RootPackageInterface
$requires array

mergeSuggests() protected méthode

Merge suggested packages into a RootPackageInterface
protected mergeSuggests ( Composer\Package\RootPackageInterface $root )
$root Composer\Package\RootPackageInterface

prependRepositories() protected méthode

Add a collection of repositories described by the given configuration to the given package and the global repository manager.
protected prependRepositories ( Composer\Package\RootPackageInterface $root )
$root Composer\Package\RootPackageInterface

readPackageJson() protected méthode

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.
protected readPackageJson ( string $path ) : array
$path string
Résultat array

replaceSelfVersionDependencies() protected méthode

Update Links with a 'self.version' constraint with the root package's version.
protected replaceSelfVersionDependencies ( string $type, array $links, Composer\Package\RootPackageInterface $root ) : array
$type string Link type
$links array
$root Composer\Package\RootPackageInterface
Résultat array

unwrapIfNeeded() public static méthode

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.
public static unwrapIfNeeded ( Composer\Package\RootPackageInterface $root, string $method = 'setExtra' ) : Composer\Package\RootPackageInterface | Composer\Package\RootPackage
$root Composer\Package\RootPackageInterface
$method string Method needed
Résultat Composer\Package\RootPackageInterface | Composer\Package\RootPackage

Property Details

$composer protected_oe property

protected Composer,Composer $composer
Résultat Composer\Composer

$json protected_oe property

protected array $json
Résultat array

$logger protected_oe property

protected Logger,Wikimedia\Composer $logger
Résultat Wikimedia\Composer\Logger

$package protected_oe property

protected CompletePackage,Composer\Package $package
Résultat Composer\Package\CompletePackage

$path protected_oe property

protected string $path
Résultat string

$versionParser protected_oe property

protected VersionParser,Composer\Package\Version $versionParser
Résultat Composer\Package\Version\VersionParser