| Total Complexity | 8 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class ColonyLoader implements ColonyLoaderInterface |
||
| 16 | { |
||
| 17 | 5 | public function __construct(private ColonyRepositoryInterface $colonyRepository, private LockManagerInterface $lockManager) |
|
| 18 | { |
||
| 19 | 5 | } |
|
| 20 | |||
| 21 | 36 | #[Override] |
|
| 22 | public function loadWithOwnerValidation(int $colonyId, int $userId, bool $checkForEntityLock = true): ColonyInterface |
||
| 23 | { |
||
| 24 | 36 | $colony = $this->loadInternal($colonyId, $checkForEntityLock); |
|
| 25 | |||
| 26 | 34 | if ($colony->getUserId() !== $userId) { |
|
| 27 | 1 | throw new AccessViolation(sprintf("Colony owned by another user (%d)! Fool: %d", $colony->getUserId(), $userId)); |
|
| 28 | } |
||
| 29 | |||
| 30 | 33 | return $colony; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | #[Override] |
|
| 34 | public function load(int $colonyId, bool $checkForEntityLock = true): ColonyInterface |
||
| 35 | { |
||
| 36 | 1 | return $this->loadInternal($colonyId, $checkForEntityLock); |
|
| 37 | } |
||
| 38 | |||
| 39 | 37 | private function loadInternal(int $colonyId, bool $checkForEntityLock): ColonyInterface |
|
| 51 | } |
||
| 52 | } |
||
| 53 |
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