| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Gets the provider for an index. |
||
| 45 | * |
||
| 46 | * @throws \InvalidArgumentException if no provider was registered for the index and type |
||
| 47 | */ |
||
| 48 | 2 | public function getProvider(string $index): ?PagerProviderInterface |
|
| 49 | { |
||
| 50 | 2 | if (!$this->providers->has($index)) { |
|
| 51 | 1 | throw new \InvalidArgumentException(sprintf('No provider was registered for index "%s".', $index)); |
|
| 52 | } |
||
| 53 | |||
| 54 | 1 | return $this->providers->get($index); |
|
| 57 |