| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function getRepository(string $tool, string $type) |
||
| 24 | { |
||
| 25 | $tool = $this->toolChain->getToolFromName($tool); |
||
| 26 | |||
| 27 | $resourceTypeList = $tool->getResourceTypes(); |
||
| 28 | if (!isset($resourceTypeList[$type])) { |
||
| 29 | throw new InvalidArgumentException("Resource type doesn't exist: $type"); |
||
| 30 | } |
||
| 31 | |||
| 32 | $typeConfig = $resourceTypeList[$type]; |
||
| 33 | $repo = $typeConfig['repository']; |
||
| 34 | |||
| 35 | if (false === class_exists($repo)) { |
||
| 36 | throw new InvalidArgumentException("Check that this classes exists: $repo"); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $repo; |
||
| 40 | } |
||
| 42 |