Get a cached version of the verb

@param \Assimp\Command\Verbs\Interfaces\CacheableInterface $verb
@return \Assimp\Command\Result\Interfaces\ResultInterface|null
19113
private static function getCached(CacheableInterface $verb): ResultInterface
    {
        $key = $verb->getCacheKey();
        if (array_key_exists($key, self::$cache)) {
            return self::$cache[$key];
        }
        return null;
    }
593798
public function request($verb, $params = [])
    {
        $xml = $this->getOaiResponse($verb, $params);
        return $this->responseProcessor
            ? $this->responseProcessor->process($xml) : $xml;
    }
363251
public static function loadRepository(CacheRepositoryInterface $repository)
  {
    return self::getOrInit(get_class($repository), function () use ($repository) {
      return $repository->getSingleton();
    });
  }
788599
public function methodIs($verb)
    {

        $method = $this->getVerb();
        $return = ($method === strtolower($verb)) ? true : false;

        return $return;
    }
111475
private function cacheKeyFromRequest(RequestInterface $request)
    {
        $uri = $request->getUri();

        $queryStr = $uri->getQuery();
        if (!empty($queryStr)) {
            $queryArr = [];

            parse_str($queryStr, $queryArr);

            $queryArr = $this->parseIgnoredParams($queryArr);
            $queryStr = http_build_query($queryArr);

            $uri = $uri->withQuery($queryStr);
        }

        $cacheKey = 'request/' . $request->getMethod() . '/' . md5((string)$uri);
        return $cacheKey;
    }
1087723
public function request($verb, $arguments)
    {
        $this->emit('request.start', array(
            'verb' => $verb,
            'arguments' => $arguments
        ));
        $url = $this->urlBuilder($verb, $arguments);
        $attempt = 0;
        while (true) {
            try {
                $res = $this->httpClient->get($url, $this->getHttpOptions());
                break;
            } catch (\GuzzleHttp\Exception\ConnectException $e) {
                // Thrown in case of a networking error (connection timeout, DNS errors, etc.)
                $this->emit('request.error', array(
                    'message' => $e->getMessage(),
                ));
                time_nanosleep(intval($this->sleepTimeOnError), intval($this->sleepTimeOnError * 1000000000));
            } catch (\GuzzleHttp\Exception\ServerException $e) {
                // Thrown in case of 500 errors
                $this->emit('request.error', array(
                    'message' => $e->getMessage(),
                ));
                time_nanosleep(intval($this->sleepTimeOnError), intval($this->sleepTimeOnError * 1000000000));
            }
            $attempt++;
            if ($attempt > $this->maxRetries) {
                throw new ConnectionError('Failed to get a response from the server. Max retries (' . $this->maxRetries . ') exceeded.');
            }
        }
        $body = (string) $res->getBody();
        $this->emit('request.complete', array(
            'verb' => $verb,
            'arguments' => $arguments,
            'response' => $body
        ));
        return $body;
    }
1265805
public function request($verb, array $params = array())
    {
        if (! $this->url) {
            throw new RuntimeException("Cannot perform request when URL not set.  Use setUrl() method");
        }

        //Build the URL
        $params = array_merge(array('verb' => $verb), $params);
        $url = $this->url . (parse_url($this->url, PHP_URL_QUERY) ? '&' : '?') . http_build_query($params);

        //Do the request
        try {
            $resp = $this->httpAdapter->request($url);
            return $this->decodeResponse($resp);
        } catch (HttpException $e) {
            $this->checkForOaipmhException($e);
        }
    }
444690
protected function getCacheKey(RequestInterface $request): string
    {
        if ($this->key === null) {
            $this->key = $request->getMethod() . md5((string)$request->getUri());
        }
        return (string)$this->key;
    }
276459
protected function getCacheKey(RequestInterface $request)
    {
        // Allow cache.key_filter to trim down the URL cache key by removing generate query string values (e.g. auth)
        if ($filter = $request->getParams()->get('cache.key_filter')) {
            $url = $request->getUrl(true);
            foreach (explode(',', $filter) as $remove) {
                $url->getQuery()->remove(trim($remove));
            }
        } else {
            $url = $request->getUrl();
        }

        return $this->keyPrefix . md5($request->getMethod() . ' ' . $url);
    }
608155
protected function sendRequest($verb, $params = [])
    {
        $response = $this->communicator->request($verb, $params);
        $this->checkResponseForErrors($response);
        return $response;
    }
690797
protected function verbToOperation($verb)
    {
        switch (strtoupper($verb)) {
            case Doozr_Http::REQUEST_METHOD_POST:
                $operation = 'create';
                break;

            case Doozr_Http::REQUEST_METHOD_GET:
                $operation = 'read';
                break;

            case Doozr_Http::REQUEST_METHOD_PUT:
                $operation = 'update';
                break;

            case Doozr_Http::REQUEST_METHOD_DELETE:
                $operation = 'delete';
                break;

            case Doozr_Http::REQUEST_METHOD_OPTIONS:
                $operation = 'options';
                break;

            case Doozr_Http::REQUEST_METHOD_HEAD:
                $operation = 'meta';
                break;

            default:
                $operation = 'read';
                break;
        }

        return $operation;
    }
1187815
private static function addCached(CacheableInterface $verb, ResultInterface $result): void
    {
        self::$cache[$verb->getCacheKey()] = $result;
    }
715437
protected function getResponse($verb, $resource, array $data = array())
    {
        $dispatcher = new RequestDispatcher();
        $request = new Request($resource);

        $this->setRequestHeaders($request);

        $this->prepareRequest($verb, $data, $request);

        $dispatcher->add($request);
        $dispatcher->execute();

        $responses = $this->getRequestContent($dispatcher);

        $this->checkResponseForErrors($responses);

        return json_decode($responses[0]->getContent());
    }
423428
protected function getBinding(string $interface)
    {
        // If there's a targeted binding, use it
        if ($this->currentTarget !== self::$emptyTarget && isset($this->bindings[$this->currentTarget][$interface])) {
            return $this->bindings[$this->currentTarget][$interface];
        }

        // If there's a universal binding, use it
        if (isset($this->bindings[self::$emptyTarget][$interface])) {
            return $this->bindings[self::$emptyTarget][$interface];
        }

        return null;
    }
261532
public function get($key) {
        if (!isset($this->cache[$key]) OR $this->cache[$key]['ttl'] <= $this->getNow()) {
            return null;
        }
        return $this->cache[$key]['value'];
    }
692154
protected function getResults($method)
    {
        if ($this->schema) {
            // set root constraints
            if (isset($this->constraints[$this->root])) {
                $this->constraints[$this->root]($this->eloquentQuery);
            }

            // set eager load constraints
            $this->eloquentQuery->setEagerLoads($this->parseRelationsFromSchema($this->schema, ''));

            // execute query
            $results = $this->eloquentQuery->$method();

            // transform to data transfer objects
            if ($results) {
                $dtos = $results->toDataTransferObject($this->root, $this->schema, $this->transformations);
                
                return [$this->root => $dtos];
            }
        }

        return null;
    }
605384
protected function getVocabulary($prefix, ContextInterface $context)
    {
        return (empty($prefix) || !($context instanceof RdfaLiteContext)) ?
            $context->getDefaultVocabulary() : $context->getVocabulary($prefix);
    }