File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 88
99class 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 }
You can’t perform that action at this time.
0 commit comments