private function rotateIfNeeded()
    {
        if (isset($this->interval) && $this->interval >= 0) {
            $modificationTime = $this->getLastModificationTime();

            if (null === $modificationTime) {
                $this->regen();
            } elseif (($modificationTime + $this->interval) < time()) {
                $this->rotate();
            }
        }
    }