| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 2 | public function getServiceUrl($serviceName, $serviceType, $region, $urlType = self::DEFAULT_URL_TYPE) |
|
| 38 | { |
||
| 39 | 2 | foreach ($this->entries as $entry) { |
|
| 40 | 1 | if ($entry->matches($serviceName, $serviceType) && ($url = $entry->getEndpointUrl($region, $urlType))) { |
|
| 41 | 1 | return $url; |
|
| 42 | } |
||
| 43 | 1 | } |
|
| 44 | |||
| 45 | 1 | throw new \RuntimeException(sprintf( |
|
| 46 | 1 | "Endpoint URL could not be found in the catalog for this service.\nName: %s\nType: %s\nRegion: %s\nURL type: %s", |
|
| 47 | 1 | $serviceName, $serviceType, $region, $urlType |
|
| 48 | 1 | )); |
|
| 49 | } |
||
| 50 | } |
||
| 51 |