providers[ $provider->getId() ] = $provider; } public function get( string $id ): ?ProviderInterface { return $this->providers[ $id ] ?? null; } /** @return ProviderInterface[] */ public function all(): array { return $this->providers; } /** Reset singleton — for use in tests only */ public static function reset(): void { self::$instance = null; } /** Returns ['id' => 'Name'] for dropdowns */ public function getSelectOptions(): array { $options = array(); foreach ( $this->providers as $id => $provider ) { $options[ $id ] = $provider->getName(); } return $options; } }