protected function writeFile($filePath, $namespace, $content, array $uses = [])
    {
        $data = '<?php' . ($namespace ? "\nnamespace " . $namespace . ';' : '') . "\n\n";
        if (count($uses)) {
            foreach ($uses as $use) {
                $data .= "use " . $use . ";\n";
            }
            $data .= "\n";
        }
        $data .= trim(preg_replace("/\n\n\n+/", "\n\n", $content));
        return file_put_contents($filePath, $data);
    }