src/generator/CodeFileGenerator.php 1 location
|
@@ 13-23 (lines=11) @@
|
| 10 |
|
/** |
| 11 |
|
* @param CodeFileGeneratorConfig|array $config |
| 12 |
|
*/ |
| 13 |
|
public function __construct($config = null) { |
| 14 |
|
if (is_array($config)) { |
| 15 |
|
$this->config = new CodeFileGeneratorConfig($config); |
| 16 |
|
} else if ($config instanceof CodeFileGeneratorConfig) { |
| 17 |
|
$this->config = $config; |
| 18 |
|
} else { |
| 19 |
|
$this->config = new CodeFileGeneratorConfig(); |
| 20 |
|
} |
| 21 |
|
|
| 22 |
|
$this->init(); |
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* @return CodeFileGeneratorConfig |
src/generator/CodeGenerator.php 1 location
|
@@ 21-31 (lines=11) @@
|
| 18 |
|
* |
| 19 |
|
* @param CodeGeneratorConfig|array $config |
| 20 |
|
*/ |
| 21 |
|
public function __construct($config = null) { |
| 22 |
|
if (is_array($config)) { |
| 23 |
|
$this->config = new CodeGeneratorConfig($config); |
| 24 |
|
} else if ($config instanceof CodeGeneratorConfig) { |
| 25 |
|
$this->config = $config; |
| 26 |
|
} else { |
| 27 |
|
$this->config = new CodeGeneratorConfig(); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
$this->init(); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
protected function init() { |
| 34 |
|
$visitor = new DefaultVisitor($this->config); |