@@ -42,8 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | public function compile($internal=false) { |
45 | - if ($internal===false&&$this->autoCompile===true) |
|
46 | - throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
45 | + if ($internal===false&&$this->autoCompile===true) { |
|
46 | + throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
47 | + } |
|
47 | 48 | foreach ( $this->components as $component ) { |
48 | 49 | $component->compile(); |
49 | 50 | } |
@@ -60,13 +61,14 @@ discard block |
||
60 | 61 | $this->components [$attachTo]=$component; |
61 | 62 | } |
62 | 63 | $component->attach($attachTo); |
63 | - }else{ |
|
64 | + } else{ |
|
64 | 65 | $this->components []=$component; |
65 | 66 | } |
66 | 67 | } |
67 | - if (isset($params)) |
|
68 | - if (\is_array($params)) |
|
68 | + if (isset($params)) { |
|
69 | + if (\is_array($params)) |
|
69 | 70 | $component->setParams($params); |
71 | + } |
|
70 | 72 | return $component; |
71 | 73 | } |
72 | 74 |