private function clearExpiredCacheEntries(int $now)
    {
        $this->now = $now;

        foreach ($this->cacheTimeouts as $path => $timeout) {
            if ($now <= $timeout) {
                break;
            }

            $fileInfo = $this->cache[$path];

            unset(
                $this->cache[$path],
                $this->cacheTimeouts[$path]
            );

            $this->bufferedFileCount -= isset($fileInfo->buffer);
            $this->cacheEntryCount--;
        }
    }