Passed
Push — master ( 487a44...cebb17 )
by Iman
02:39
created
src/Utils/WidgetRenderer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.