Skip to content

Commit 07a73aa

Browse files
committed
Bugfix
1 parent f57330d commit 07a73aa

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/generator/CodeFileGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class CodeFileGenerator extends CodeGenerator {
1313
public function __construct($config = null) {
1414
if (is_array($config)) {
1515
$this->config = new CodeFileGeneratorConfig($config);
16-
} else if ($config === null) {
17-
$this->config = new CodeFileGeneratorConfig();
1816
} else if ($config instanceof CodeFileGeneratorConfig) {
1917
$this->config = $config;
20-
}
18+
} else {
19+
$this->config = new CodeFileGeneratorConfig();
20+
}
2121

2222
$this->init();
2323
}

src/generator/CodeGenerator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88

99
class CodeGenerator {
1010

11-
private $config;
11+
protected $config;
1212

1313
/**
1414
* @var DefaultGeneratorStrategy
1515
*/
16-
private $strategy;
16+
protected $strategy;
1717

1818
/**
1919
*
2020
* @param CodeGeneratorConfig|array $config
2121
*/
2222
public function __construct($config = null) {
23-
if (is_array($config)) {
23+
if (is_array($config)) {
2424
$this->config = new CodeGeneratorConfig($config);
25-
} else if ($config === null) {
26-
$this->config = new CodeGeneratorConfig();
2725
} else if ($config instanceof CodeGeneratorConfig) {
2826
$this->config = $config;
29-
}
27+
} else {
28+
$this->config = new CodeGeneratorConfig();
29+
}
3030

3131
$this->init();
3232
}

0 commit comments

Comments
 (0)