protected function cleanup($fileToRotate)
    {

        // load the maximum number of files to keep
        $maxFiles = $this->getMaxFiles();

        // skip GC of old logs if files are unlimited
        if (0 === $maxFiles) {
            return;
        }

        // load the rotated log files
        $logFiles = glob($this->getGlobPattern($fileToRotate, 'gz'));

        // query whether we've the maximum number of files reached
        if ($maxFiles >= count($logFiles)) {
            return;
        }

        // iterate over the files we want to clean-up
        foreach (array_slice($logFiles, $maxFiles) as $fileToDelete) {
            unlink($fileToDelete);
        }
    }