| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Arcanedev\Composer\Entities\PackageTraits; |
||
| 24 | protected function mergePackageLinks($type, RootPackageInterface $root) |
||
| 25 | { |
||
| 26 | $linkType = BasePackage::$supportedLinkTypes[$type]; |
||
| 27 | $getter = 'get' . ucfirst($linkType['method']); |
||
| 28 | $setter = 'set' . ucfirst($linkType['method']); |
||
| 29 | |||
| 30 | $links = $this->package->{$getter}(); |
||
|
|
|||
| 31 | |||
| 32 | if (empty($links)) return; |
||
| 33 | |||
| 34 | $unwrapped = self::unwrapIfNeeded($root, $setter); |
||
| 35 | |||
| 36 | // @codeCoverageIgnoreStart |
||
| 37 | if ($root !== $unwrapped) { |
||
| 38 | $this->logger->warning( |
||
| 39 | 'This Composer version does not support ' . |
||
| 40 | "'{$type}' merging for aliased packages." |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | // @codeCoverageIgnoreEnd |
||
| 44 | |||
| 45 | $unwrapped->{$setter}(array_merge( |
||
| 46 | $root->{$getter}(), |
||
| 47 | $this->replaceSelfVersionDependencies($type, $links, $root) |
||
| 48 | )); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
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: