public function setDocRoot($docRoot)
    {
        if (empty($docRoot) || ! file_exists($docRoot) || ! is_dir($docRoot)) {
            throw new \InvalidArgumentException(
                'The document root set is not a valid directory.'
            );
        }
        $this->docRoot = rtrim($docRoot, '/');
    }