| Total Complexity | 7 | 
| Total Lines | 34 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 23 | final class ProviderRegistry  | 
            ||
| 24 | { | 
            ||
| 25 | /**  | 
            ||
| 26 | * @var ProviderInterface[]  | 
            ||
| 27 | */  | 
            ||
| 28 | protected array $providers = [];  | 
            ||
| 29 | |||
| 30 | public function registerProvider(ProviderInterface $provider, array $attributes): void  | 
            ||
| 31 |     { | 
            ||
| 32 | $this->providers[$attributes['identifier']] = $provider($attributes);  | 
            ||
| 33 | }  | 
            ||
| 34 | |||
| 35 | public function hasProvider(string $identifer): bool  | 
            ||
| 36 |     { | 
            ||
| 37 | return isset($this->providers[$identifer]);  | 
            ||
| 38 | }  | 
            ||
| 39 | |||
| 40 | public function getProvider(string $identifier): ProviderInterface  | 
            ||
| 41 |     { | 
            ||
| 42 |         if (!isset($this->providers[$identifier])) { | 
            ||
| 43 |             throw new \InvalidArgumentException('No provider for identifier ' . $identifier . 'found.', 1606490398); | 
            ||
| 44 | }  | 
            ||
| 45 | |||
| 46 | return $this->providers[$identifier];  | 
            ||
| 47 | }  | 
            ||
| 48 | |||
| 49 | public function getProviders(): array  | 
            ||
| 52 | }  | 
            ||
| 53 | |||
| 54 | public function getFirstProvider(): ?ProviderInterface  | 
            ||
| 57 | }  | 
            ||
| 58 | }  | 
            ||
| 59 |