| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.009 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 3 | public function fetch(string $uri): array |
|
| 30 | { |
||
| 31 | 3 | $lastException = null; |
|
| 32 | |||
| 33 | 3 | $providers = array_filter($this->providers, static function (RemoteProviderInterface $provider) use ($uri): bool { |
|
| 34 | 3 | return $provider->isAllowedUri($uri); |
|
| 35 | 3 | }); |
|
| 36 | |||
| 37 | 3 | foreach ($providers as $provider) { |
|
| 38 | try { |
||
| 39 | 3 | return $provider->fetch($uri); |
|
| 40 | 1 | } catch (ExceptionInterface $e) { |
|
| 41 | 1 | $lastException = $e; |
|
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | throw new RuntimeException('Unable to fetch issuer metadata', 0, $lastException); |
||
| 46 | } |
||
| 48 |