| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function getItems(WritableRepositoryInterface $repository) |
||
| 35 | { |
||
| 36 | $packages = $repository->getPackages(); |
||
| 37 | |||
| 38 | if (empty($this->packages)) { |
||
| 39 | return $packages; |
||
|
|
|||
| 40 | } |
||
| 41 | |||
| 42 | $filter = $this->filterUtils->composeRegex($this->packages, '/'); |
||
| 43 | |||
| 44 | return array_filter( |
||
| 45 | $packages, |
||
| 46 | function (PackageInterface $package) use ($filter) { |
||
| 47 | return preg_match($filter, $package->getName()); |
||
| 48 | } |
||
| 52 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: