public function __construct($config = null)
{
if (is_array($config)) {
$this->config = new CodeGeneratorConfig($config);
} else {
if ($config instanceof CodeGeneratorConfig) {
$this->config = $config;
} else {
$this->config = new CodeGeneratorConfig(['generateDocblock' => false]);
}
}
$this->writer = new Writer();
$this->factory = new BuilderFactory($this);
}