@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | if(!is_null($setter)){ |
| 36 | 36 | $this->form_model = $setter; |
| 37 | - } |
|
| 38 | - elseif(is_null($this->form_model)){ |
|
| 37 | + } elseif(is_null($this->form_model)){ |
|
| 39 | 38 | $reflection = new \ReflectionClass($this->modelClassName()); |
| 40 | 39 | $this->form_model = $reflection->newInstanceWithoutConstructor(); //That's it! |
| 41 | 40 | } |
@@ -46,8 +45,9 @@ discard block |
||
| 46 | 45 | public function modelType(): string |
| 47 | 46 | { |
| 48 | 47 | // have to go through the model to garantee model_type existence via interface |
| 49 | - if(is_null($this->model_type)) |
|
| 50 | - $this->model_type = get_class($this->formModel())::model_type(); |
|
| 48 | + if(is_null($this->model_type)) { |
|
| 49 | + $this->model_type = get_class($this->formModel())::model_type(); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | return $this->model_type; |
| 53 | 53 | } |
@@ -56,8 +56,9 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $ret = $this->modelType(); |
| 58 | 58 | |
| 59 | - if(!is_null($suffix)) |
|
| 60 | - $ret .= '_'.$suffix; |
|
| 59 | + if(!is_null($suffix)) { |
|
| 60 | + $ret .= '_'.$suffix; |
|
| 61 | + } |
|
| 61 | 62 | |
| 62 | 63 | return $ret; |
| 63 | 64 | } |