| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Copyright © Vaimo Group. All rights reserved. |
||
| 4 | * See LICENSE_VAIMO.txt for license details. |
||
| 5 | */ |
||
| 6 | namespace Vaimo\ComposerPatches\Sources; |
||
| 7 | |||
| 8 | class ProjectSource implements \Vaimo\ComposerPatches\Interfaces\PatchSourceListInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Composer\Package\RootPackageInterface |
||
| 12 | */ |
||
| 13 | private $rootPackage; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param \Composer\Package\RootPackageInterface $rootPackage |
||
| 17 | */ |
||
| 18 | public function __construct( |
||
| 19 | \Composer\Package\RootPackageInterface $rootPackage |
||
| 20 | ) { |
||
| 21 | $this->rootPackage = $rootPackage; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getItems(\Composer\Repository\WritableRepositoryInterface $repository) |
||
| 25 | { |
||
| 26 | return array($this->rootPackage); |
||
|
0 ignored issues
–
show
|
|||
| 27 | } |
||
| 28 | } |
||
| 29 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: