src/Command/Generate/AbstractGenerateCommand.php
protected function generateFile($class, $file, array $data = []) : void
    {
        if (file_exists($file) && !$this->getInput()->getOption('force')) {
            $this->comment(" |> File <info>$file</info> already exists");
            return;
        }

        $template = $this->getTemplate($class);
        $template->setFilePath($file);
        $template->setTemplateData($data);

        $generator = new Generator($template);
        $generator->make();
    }
protected function generateFile($class, $file, array $data = []) : void
    {
        if (file_exists($file) && !$this->getInput()->getOption('force')) {
            $this->comment(" |> File <info>$file</info> already exists");
            return;
        }

        $template = $this->getTemplate($class);
        $template->setFilePath($file);
        $template->setTemplateData($data);

        $generator = new Generator($template);
        $generator->make();
    }
Small wrapper for simplify code

@param  string $class
@param  string $file
@param  array  $data

@return void