1 | <?php namespace Arcanedev\Composer\Entities\PackageTraits; |
||
13 | trait ExtraTrait |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Properties |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** @var \Arcanedev\Composer\Utilities\Logger $logger */ |
||
20 | protected $logger; |
||
21 | |||
22 | /** @var \Composer\Package\CompletePackage $package */ |
||
23 | protected $package; |
||
24 | |||
25 | /** @var string $path */ |
||
26 | protected $path; |
||
27 | |||
28 | /* ------------------------------------------------------------------------------------------------ |
||
29 | | Main Functions |
||
30 | | ------------------------------------------------------------------------------------------------ |
||
31 | */ |
||
32 | /** |
||
33 | * Merge extra config into a RootPackage. |
||
34 | * |
||
35 | * @param \Composer\Package\RootPackageInterface $root |
||
36 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
37 | */ |
||
38 | protected function mergeExtra(RootPackageInterface $root, PluginState $state) |
||
50 | |||
51 | /** |
||
52 | * Get extra config. |
||
53 | * |
||
54 | * @param \Composer\Package\RootPackageInterface $root |
||
55 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
56 | * @param array $extra |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | private function getExtra( |
||
80 | |||
81 | /** |
||
82 | * Merges two arrays either via arrayMergeDeep or via array_merge. |
||
83 | * |
||
84 | * @param bool $mergeDeep |
||
85 | * @param array $array1 |
||
86 | * @param array $array2 |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | private static function mergeExtraArray($mergeDeep, $array1, $array2) |
||
96 | |||
97 | /** |
||
98 | * Get a full featured Package from a RootPackageInterface. |
||
99 | * |
||
100 | * @param \Composer\Package\RootPackageInterface|\Composer\Package\RootPackage $root |
||
101 | * @param string $method |
||
102 | * |
||
103 | * @return \Composer\Package\RootPackageInterface|\Composer\Package\RootPackage |
||
104 | */ |
||
105 | abstract protected function unwrapIfNeeded( |
||
108 | } |
||
109 |