@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | return app($widget); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - $widget = app()->getNamespace().'Widgets\\'.$widget; |
|
| 52 | + $widget = app()->getNamespace() . 'Widgets\\' . $widget; |
|
| 53 | 53 | |
| 54 | 54 | return app($widget); |
| 55 | 55 | } |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | private function generateHtml($widget, ...$args) |
| 66 | 66 | { |
| 67 | 67 | // Everything inside this function is executed only when the cache is not available. |
| 68 | - $expensivePhpCode = function () use ($widget, $args) { |
|
| 68 | + $expensivePhpCode = function() use ($widget, $args) { |
|
| 69 | 69 | $this->makeDataForView($widget, $args); |
| 70 | 70 | |
| 71 | 71 | return $this->renderTemplate($widget, ...$args); |
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | - if (! $widget->cacheView) { |
|
| 74 | + if (!$widget->cacheView) { |
|
| 75 | 75 | return $expensivePhpCode(); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | private function makeDataForView($widget, array $args) |
| 89 | 89 | { |
| 90 | - $expensiveCode = function () use ($widget, $args) { |
|
| 90 | + $expensiveCode = function() use ($widget, $args) { |
|
| 91 | 91 | |
| 92 | 92 | // Here we call the data method on the widget class. |
| 93 | 93 | $viewData = \App::call($widget->controller, ...$args); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | try { |
| 124 | 124 | $this->html = view($widget->template, $data)->render(); |
| 125 | 125 | } catch (\Throwable $t) { |
| 126 | - throw new \ErrorException('There was some error rendering '.get_class($widget).', template file: \''.$widget->template.'\' Error: '. $t->getMessage()); |
|
| 126 | + throw new \ErrorException('There was some error rendering ' . get_class($widget) . ', template file: \'' . $widget->template . '\' Error: ' . $t->getMessage()); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // We try to minify the html before storing it in cache to save space. |