@@ -93,8 +93,8 @@ |
||
| 93 | 93 | public function getHtmlComponent($identifier){ |
| 94 | 94 | return $this->htmlComponents[$identifier]??''; |
| 95 | 95 | } |
| 96 | - public function clearComponents(){ |
|
| 97 | - $this->components=[]; |
|
| 98 | - $this->htmlComponents=[]; |
|
| 99 | - } |
|
| 96 | + public function clearComponents(){ |
|
| 97 | + $this->components=[]; |
|
| 98 | + $this->htmlComponents=[]; |
|
| 99 | + } |
|
| 100 | 100 | } |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | protected $js; |
| 31 | 31 | |
| 32 | - public function __construct($autoCompile = true) { |
|
| 33 | - $this->autoCompile = $autoCompile; |
|
| 34 | - $this->components = array(); |
|
| 35 | - $this->htmlComponents = array(); |
|
| 32 | + public function __construct($autoCompile=true) { |
|
| 33 | + $this->autoCompile=$autoCompile; |
|
| 34 | + $this->components=array(); |
|
| 35 | + $this->htmlComponents=array(); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function isAutoCompile() { |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function setAutoCompile($autoCompile) { |
| 43 | - $this->autoCompile = $autoCompile; |
|
| 43 | + $this->autoCompile=$autoCompile; |
|
| 44 | 44 | return $this; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function compile($internal = false) { |
|
| 48 | - if ($internal === false && $this->autoCompile === true) |
|
| 47 | + public function compile($internal=false) { |
|
| 48 | + if ($internal===false && $this->autoCompile===true) |
|
| 49 | 49 | throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
| 50 | 50 | foreach ($this->components as $component) { |
| 51 | 51 | $component->compile(); |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function setJs(JsUtils $js) { |
| 56 | - $this->js = $js; |
|
| 56 | + $this->js=$js; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function addComponent(SimpleComponent $component, $attachTo, $params) { |
| 60 | 60 | if ($this->autoCompile) { |
| 61 | - if ($attachTo != null) { |
|
| 62 | - if (! isset($this->components[$attachTo])) { |
|
| 63 | - $this->components[$attachTo] = $component; |
|
| 61 | + if ($attachTo!=null) { |
|
| 62 | + if (!isset($this->components[$attachTo])) { |
|
| 63 | + $this->components[$attachTo]=$component; |
|
| 64 | 64 | } else { |
| 65 | - $this->components[] = $component; |
|
| 65 | + $this->components[]=$component; |
|
| 66 | 66 | } |
| 67 | 67 | $component->attach($attachTo); |
| 68 | 68 | } else { |
| 69 | - $this->components[] = $component; |
|
| 69 | + $this->components[]=$component; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | if (isset($params)) |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function addHtmlComponent(BaseHtml $htmlComponent) { |
| 79 | - $this->htmlComponents[$htmlComponent->getIdentifier()] = $htmlComponent; |
|
| 79 | + $this->htmlComponents[$htmlComponent->getIdentifier()]=$htmlComponent; |
|
| 80 | 80 | return $htmlComponent; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function compileHtml(JsUtils $js = NULL, &$view = NULL) { |
|
| 83 | + public function compileHtml(JsUtils $js=NULL, &$view=NULL) { |
|
| 84 | 84 | foreach ($this->htmlComponents as $htmlComponent) { |
| 85 | 85 | $htmlComponent->compile($js, $view); |
| 86 | 86 | } |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | return array_filter($this->htmlComponents, $callback); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - public function getHtmlComponent($identifier){ |
|
| 94 | - return $this->htmlComponents[$identifier]??''; |
|
| 93 | + public function getHtmlComponent($identifier) { |
|
| 94 | + return $this->htmlComponents[$identifier] ?? ''; |
|
| 95 | 95 | } |
| 96 | - public function clearComponents(){ |
|
| 96 | + public function clearComponents() { |
|
| 97 | 97 | $this->components=[]; |
| 98 | 98 | $this->htmlComponents=[]; |
| 99 | 99 | } |