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];
}