public function setDir(string $dir)
    {
        if (!is_dir($dir)) {
            throw new Exception('Directory does not exist: ' . $dir);
        }

        $this->config['dir'] = rtrim($dir, '/\\') . DIRECTORY_SEPARATOR;
    }