Aerys\Router::cacheDispatchResult PHP Method

cacheDispatchResult() private method

private cacheDispatchResult ( string $toMatch, array $routeArgs, array $action )
$toMatch string
$routeArgs array
$action array
    private function cacheDispatchResult(string $toMatch, array $routeArgs, array $action)
    {
        if ($this->cacheEntryCount < $this->maxCacheEntries) {
            $this->cacheEntryCount++;
        } else {
            // Remove the oldest entry from the LRU cache to make room
            $unsetMe = key($this->cache);
            unset($this->cache[$unsetMe]);
        }
        $cacheKey = $toMatch;
        $this->cache[$cacheKey] = [$action, $routeArgs];
    }