1 | <?php namespace Arcanedev\Composer\Entities\PackageTraits; |
||
13 | trait ExtraTrait |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Merge extra config into a RootPackage. |
||
21 | * |
||
22 | * @param \Composer\Package\RootPackageInterface $root |
||
23 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
24 | */ |
||
25 | protected function mergeExtra(RootPackageInterface $root, PluginState $state) |
||
38 | |||
39 | /** |
||
40 | * Get extra config. |
||
41 | * |
||
42 | * @param \Composer\Package\RootPackageInterface $root |
||
43 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
44 | * @param array $extra |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | private function getExtra( |
||
68 | |||
69 | /** |
||
70 | * Merges two arrays either via arrayMergeDeep or via array_merge. |
||
71 | * |
||
72 | * @param bool $mergeDeep |
||
73 | * @param array $array1 |
||
74 | * @param array $array2 |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | private static function mergeExtraArray($mergeDeep, $array1, $array2) |
||
84 | } |
||
85 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: