public function resolve(string $path): IEngine
    {
        if ($this->cache === null) {
            $this->cache = [];
            foreach ($this->engines as $engine) {
                $this->cache[] = $engine[0]($this->renderer);
            }
        }

        foreach ($this->cache as $engine) {
            if ($engine->canHandle($path)) {
                return $engine;
            }
        }

        return $this->renderer->getDefaultEngine();
    }
public function resolve(string $path): IEngine
    {
        if ($this->cache === null) {
            $this->cache = [];
            foreach ($this->engines as $engine) {
                $this->cache[] = $engine[0]($this->renderer);
            }
        }

        foreach ($this->cache as $engine) {
            if ($engine->canHandle($path)) {
                return $engine;
            }
        }

        return $this->renderer->getDefaultEngine();
    }
public function resolve ( string $ path ) : IEngine { if ( $ this -> cache === null ) { $ this -> cache = [ ] ; foreach ( $ this -> engines as $ engine ) { $ this -> cache [ ] = $ engine [ 0 ] ( $ this -> renderer ) ; } } foreach ( $ this -> cache as $ engine ) { if ( $ engine -> canHandle ( $ path ) ) { return $ engine ; } } return $ this -> renderer -> getDefaultEngine ( ) ; }
Resolve a path to a render engine

@param   string $path

@return  IEngine
Resolve a path to a render engine