public function haveTheme(
        $folder,
        $indexFileCode,
        $functionsFileCode = null
    ) {
        $dir = $this->config['themes'] . Utils::untrailslashit(Utils::unleadslashit($folder));
        $styleFile = $dir . DIRECTORY_SEPARATOR . 'style.css';
        $indexFile = $dir . DIRECTORY_SEPARATOR . 'index.php';
        $functionsFile = $dir . DIRECTORY_SEPARATOR . 'functions.php';

        if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
            throw new ModuleException(
                __CLASS__,
                "Could not create [{$dir}] theme folder."
            );
        }
        $indexFileCode = $this->removeOpeningPhpTag($indexFileCode);
        $functionsFileCode = $this->removeOpeningPhpTag($functionsFileCode);
        $name = $folder;
        $style = <<<CSS
/*
Theme Name: $name
Author: wp-browser
Description: $name
Version: 1.0
*/
CSS;
        $stylePut = file_put_contents($styleFile, $style);

        if (!$stylePut) {
            throw new ModuleException(
                __CLASS__,
                "Could not create [{$styleFile}] theme file."
            );
        }

        $this->toClean[] = $dir;

        $index = '<?php ' . $indexFileCode;

        $indexPut = file_put_contents($indexFile, $index);

        if (!$indexPut) {
            throw new ModuleException(
                __CLASS__,
                "Could not create [{$indexFile}] theme file."
            );
        }

        if (null !== $functionsFileCode) {
            $functions = '<?php ' . $functionsFileCode;

            $functionsPut = file_put_contents($functionsFile, $functions);

            if (!$functionsPut) {
                throw new ModuleException(
                    __CLASS__,
                    "Could not create [{$indexFile}] theme file."
                );
            }
        }
    }