@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $tpl = $this->getTplPath($this->widget->template); |
41 | 41 | |
42 | - $this->html = "<span title='WidgetObj : ".get_class($this->widget).".php
Template : {$tpl}{$this->cacheState()}'>{$this->html}</span>"; |
|
42 | + $this->html = "<span title='WidgetObj : " . get_class($this->widget) . ".php
Template : {$tpl}{$this->cacheState()}'>{$this->html}</span>"; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function cacheState() |
51 | 51 | { |
52 | - if (! $this->policies->widgetShouldUseCache()) { |
|
52 | + if (!$this->policies->widgetShouldUseCache()) { |
|
53 | 53 | return ' 
 Cache: is globally turned off (You should put "enable_cache" => true in config\widgetize.php) '; |
54 | 54 | } |
55 | 55 | $l = $this->widget->cacheLifeTime->i ?? 0; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function addHtmlComments(): void |
61 | 61 | { |
62 | - $this->html = "<!-- '{".get_class($this->widget)."' Widget Start -->".$this->html."<!-- '".get_class($this->widget)."' Widget End -->"; |
|
62 | + $this->html = "<!-- '{" . get_class($this->widget) . "' Widget Start -->" . $this->html . "<!-- '" . get_class($this->widget) . "' Widget End -->"; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | private function getTplPath(string $tpl) |
70 | 70 | { |
71 | 71 | if (Str::contains($tpl, 'Widgets::')) { |
72 | - $tpl = str_replace('Widgets::', app()->getNamespace().'Widgets\\', $tpl); |
|
72 | + $tpl = str_replace('Widgets::', app()->getNamespace() . 'Widgets\\', $tpl); |
|
73 | 73 | } |
74 | 74 | |
75 | - return str_replace('.', '\\', $tpl).'.blade.php'; |
|
75 | + return str_replace('.', '\\', $tpl) . '.blade.php'; |
|
76 | 76 | } |
77 | 77 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | private function checkControllerExists(string $ctrlClass): void |
31 | 31 | { |
32 | - if (! class_exists($ctrlClass)) { |
|
32 | + if (!class_exists($ctrlClass)) { |
|
33 | 33 | throw new \InvalidArgumentException("Controller class: [{$ctrlClass}] not found."); |
34 | 34 | } |
35 | 35 | } |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | [$ctrlClass, $method] = $ctrlClass; |
47 | - if (! method_exists($ctrlClass, $method)) { |
|
48 | - throw new \InvalidArgumentException("'data' method not found on ".$ctrlClass); |
|
47 | + if (!method_exists($ctrlClass, $method)) { |
|
48 | + throw new \InvalidArgumentException("'data' method not found on " . $ctrlClass); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | // We decide to call data method on the widget object by default. |
59 | 59 | // If the user has explicitly declared controller class path on |
60 | 60 | // widget then we decide to call data method on that instead. |
61 | - if (! property_exists($widget, 'controller')) { |
|
61 | + if (!property_exists($widget, 'controller')) { |
|
62 | 62 | return method_exists($widget, 'data') ? [[$widget, 'data'], null] : [null, null]; |
63 | 63 | } |
64 | 64 | |
65 | 65 | if (is_string($widget->controller)) { |
66 | - if (! Str::contains($widget->controller, '@')) { |
|
67 | - return [$widget->controller.'@data', $widget->controller]; |
|
66 | + if (!Str::contains($widget->controller, '@')) { |
|
67 | + return [$widget->controller . '@data', $widget->controller]; |
|
68 | 68 | } |
69 | 69 | $widget->controller = explode('@', $widget->controller); |
70 | 70 | } elseif (is_callable($widget->controller)) { |