| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 1 | public function getAvailableFeatures(): array |
|
| 53 | { |
||
| 54 | 1 | $currentVersion = $this->apiVersionProvider->getApiVersion(); |
|
| 55 | |||
| 56 | 1 | if ($currentVersion === null) { |
|
| 57 | throw new \RuntimeException('API version is not set'); |
||
| 58 | } |
||
| 59 | |||
| 60 | 1 | $matchingFeatures = []; |
|
| 61 | |||
| 62 | 1 | foreach ($this->features as $feature) { |
|
| 63 | 1 | if ($feature->isAvailableForVersion($currentVersion)) { |
|
| 64 | 1 | $matchingFeatures[$feature->getName()] = $feature; |
|
| 65 | } |
||
| 66 | } |
||
| 67 | |||
| 68 | 1 | return $matchingFeatures; |
|
| 69 | } |
||
| 70 | } |
||
| 71 |