1 | <?php namespace Arcanedev\Composer\Entities\PackageTraits; |
||
13 | trait RequiresTrait |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Merge require into a RootPackage. |
||
21 | * |
||
22 | * @param \Composer\Package\RootPackageInterface $root |
||
23 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
24 | */ |
||
25 | protected function mergeRequires(RootPackageInterface $root, PluginState $state) |
||
45 | |||
46 | /** |
||
47 | * Merge require-dev into RootPackage. |
||
48 | * |
||
49 | * @param \Composer\Package\RootPackageInterface $root |
||
50 | * @param \Arcanedev\Composer\Entities\PluginState $state |
||
51 | */ |
||
52 | protected function mergeDevRequires(RootPackageInterface $root, PluginState $state) |
||
72 | |||
73 | /* ------------------------------------------------------------------------------------------------ |
||
74 | | Other Functions |
||
75 | | ------------------------------------------------------------------------------------------------ |
||
76 | */ |
||
77 | /** |
||
78 | * Extract and merge stability flags from the given collection of |
||
79 | * requires and merge them into a RootPackage. |
||
80 | * |
||
81 | * @param \Composer\Package\RootPackageInterface $root |
||
82 | * @param \Composer\Package\Link[] $requires |
||
83 | */ |
||
84 | protected function mergeStabilityFlags(RootPackageInterface $root, array $requires) |
||
95 | |||
96 | /** |
||
97 | * Merge two collections of package links and collect duplicates for subsequent processing. |
||
98 | * |
||
99 | * @param \Composer\Package\Link[] $origin Primary collection |
||
100 | * @param array $merge Additional collection |
||
101 | * @param bool $replace Replace existing links ? |
||
102 | * @param array $duplicateLinks Duplicate storage |
||
103 | * |
||
104 | * @return \Composer\Package\Link[] Merged collection |
||
105 | */ |
||
106 | private function mergeLinks(array $origin, array $merge, $replace, array &$duplicateLinks) |
||
122 | } |
||
123 |
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: