> */ private array $providers = array(); public function register( string $type, ProviderInterface $provider ): bool { $id = $provider->get_id(); if ( '' === $type || '' === $id || isset( $this->providers[ $type ][ $id ] ) ) { return false; } $this->providers[ $type ][ $id ] = $provider; return true; } public function get( string $type, string $id ): ?ProviderInterface { return $this->providers[ $type ][ $id ] ?? null; } public function all( string $type ): array { return array_values( $this->providers[ $type ] ?? array() ); } }