public function resolveReader(ResourceUri $resource)
    {
        if (! array_key_exists($resource->getProtocol(), $this->protocolFactoryIndexes)) {
            throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource  . ')');
        }

        /** @var int $factoryIndex */
        $factoryIndex = $this->protocolFactoryIndexes[$resource->getProtocol()];
        /** @var ResourceReaderFactory $factory */
        $factory = $this->factories[$factoryIndex];

        return $factory->createReaderFor($resource);
    }
public function resolveReader(ResourceUri $resource)
    {
        if (! array_key_exists($resource->getProtocol(), $this->protocolFactoryIndexes)) {
            throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource  . ')');
        }

        /** @var int $factoryIndex */
        $factoryIndex = $this->protocolFactoryIndexes[$resource->getProtocol()];
        /** @var ResourceReaderFactory $factory */
        $factory = $this->factories[$factoryIndex];

        return $factory->createReaderFor($resource);
    }
public function resolveReader ( ResourceUri $ resource ) { if ( ! array_key_exists ( $ resource -> getProtocol ( ) , $ this -> protocolFactoryIndexes ) ) { throw new \ RuntimeException ( 'Unsupported protocol: ' . $ resource -> getProtocol ( ) . '( ' . $ resource . ')' ) ; } /** @var int $factoryIndex */ $ factoryIndex = $ this -> protocolFactoryIndexes [ $ resource -> getProtocol ( ) ] ; /** @var ResourceReaderFactory $factory */ $ factory = $ this -> factories [ $ factoryIndex ] ; return $ factory -> createReaderFor ( $ resource ) ; }
Resolves a reader for the given resource URI.

@param ResourceUri $resource
@return ResourceReader
Resolves a reader for the given resource URI .