| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4.0092 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 1 | #[Override] |
|
| 26 | public function delete(UserInterface $user): void |
||
| 27 | { |
||
| 28 | 1 | foreach ($this->shipBuildplanRepository->getByUser($user->getId()) as $shipBuildplan) { |
|
| 29 | |||
| 30 | 1 | $existsForeignShip = !$shipBuildplan->getShiplist() |
|
| 31 | 1 | ->filter(fn(ShipInterface $ship): bool => $ship->getUser() !== $shipBuildplan->getUser()) |
|
| 32 | 1 | ->isEmpty(); |
|
| 33 | |||
| 34 | 1 | if ($existsForeignShip) { |
|
| 35 | 1 | $user = $this->userRepository->find(UserEnum::USER_FOREIGN_BUILDPLANS); |
|
| 36 | 1 | if ($user === null) { |
|
| 37 | throw new RuntimeException(sprintf('user with id %d does not exist', UserEnum::USER_FOREIGN_BUILDPLANS)); |
||
| 38 | } |
||
| 39 | 1 | $shipBuildplan->setUser($user); |
|
| 40 | 1 | $this->shipBuildplanRepository->save($shipBuildplan); |
|
| 41 | } else { |
||
| 42 | 1 | $this->shipBuildplanRepository->delete($shipBuildplan); |
|
| 43 | } |
||
| 47 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths