1 | <?php namespace Arcanedev\Composer\Entities\PackageTraits; |
||
13 | trait RequiresTrait |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Traits |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | use PackageTrait; |
||
20 | |||
21 | /* ------------------------------------------------------------------------------------------------ |
||
22 | | Main Functions |
||
23 | | ------------------------------------------------------------------------------------------------ |
||
24 | */ |
||
25 | /** |
||
26 | * Merge require into a RootPackage. |
||
27 | * |
||
28 | * @param \Composer\Package\RootPackageInterface $root |
||
29 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
30 | */ |
||
31 | protected function mergeRequires(RootPackageInterface $root, PluginState $state) |
||
51 | |||
52 | /** |
||
53 | * Merge require-dev into RootPackage. |
||
54 | * |
||
55 | * @param \Composer\Package\RootPackageInterface $root |
||
56 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
57 | */ |
||
58 | protected function mergeDevRequires(RootPackageInterface $root, PluginState $state) |
||
78 | |||
79 | /* ------------------------------------------------------------------------------------------------ |
||
80 | | Other Functions |
||
81 | | ------------------------------------------------------------------------------------------------ |
||
82 | */ |
||
83 | /** |
||
84 | * Extract and merge stability flags from the given collection of |
||
85 | * requires and merge them into a RootPackage. |
||
86 | * |
||
87 | * @param \Composer\Package\RootPackageInterface $root |
||
88 | * @param \Composer\Package\Link[] $requires |
||
89 | */ |
||
90 | protected function mergeStabilityFlags(RootPackageInterface $root, array $requires) |
||
101 | |||
102 | /** |
||
103 | * Merge two collections of package links and collect duplicates for subsequent processing. |
||
104 | * |
||
105 | * @param \Composer\Package\Link[] $origin Primary collection |
||
106 | * @param array $merge Additional collection |
||
107 | * @param bool $replace Replace existing links ? |
||
108 | * @param array $duplicateLinks Duplicate storage |
||
109 | * |
||
110 | * @return \Composer\Package\Link[] Merged collection |
||
111 | */ |
||
112 | private function mergeLinks(array $origin, array $merge, $replace, array &$duplicateLinks) |
||
128 | |||
129 | /** |
||
130 | * Update Links with a 'self.version' constraint with the root package's version. |
||
131 | * |
||
132 | * @param string $type |
||
133 | * @param array $links |
||
134 | * @param \Composer\Package\RootPackageInterface $root |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | abstract protected function replaceSelfVersionDependencies( |
||
141 | } |
||
142 |