@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | return app($widget); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $widget = app()->getNamespace().'Widgets\\'.$widget; |
|
| 59 | + $widget = app()->getNamespace() . 'Widgets\\' . $widget; |
|
| 60 | 60 | |
| 61 | 61 | return app($widget); |
| 62 | 62 | } |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | private function generateHtml($widget, ...$args) |
| 73 | 73 | { |
| 74 | 74 | // Everything inside this function is executed only when the cache is not available. |
| 75 | - $expensivePhpCode = function () use ($widget, $args) { |
|
| 75 | + $expensivePhpCode = function() use ($widget, $args) { |
|
| 76 | 76 | $this->makeDataForView($widget, $args); |
| 77 | 77 | |
| 78 | 78 | return $this->renderTemplate($widget); |
| 79 | 79 | }; |
| 80 | 80 | |
| 81 | - if (! $widget->cacheView) { |
|
| 81 | + if (!$widget->cacheView) { |
|
| 82 | 82 | return $expensivePhpCode(); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | private function makeDataForView($widget, array $args) |
| 96 | 96 | { |
| 97 | - $expensiveCode = function () use ($widget, $args) { |
|
| 97 | + $expensiveCode = function() use ($widget, $args) { |
|
| 98 | 98 | |
| 99 | 99 | // Here we call the data method on the widget class. |
| 100 | 100 | $viewData = \App::call($widget->controller, ...$args); |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function cacheResult(array $args, callable $phpCode, $widgetObj, $form = 'HTML') |
| 31 | 31 | { |
| 32 | - if (! resolve(Policies::class)->widgetShouldUseCache() || $widgetObj->cacheLifeTime->s === 0) { |
|
| 32 | + if (!resolve(Policies::class)->widgetShouldUseCache() || $widgetObj->cacheLifeTime->s === 0) { |
|
| 33 | 33 | return $phpCode(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $cache = resolve('cache'); |
| 37 | 37 | |
| 38 | - if (! empty($widgetObj->cacheTags) && $this->cacheDriverSupportsTags()) { |
|
| 38 | + if (!empty($widgetObj->cacheTags) && $this->cacheDriverSupportsTags()) { |
|
| 39 | 39 | $cache = $cache->tags($widgetObj->cacheTags); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | $_key = json_encode($widget->extraCacheKeyDependency($arg)); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if (! $this->cacheDriverSupportsTags()) { |
|
| 67 | + if (!$this->cacheDriverSupportsTags()) { |
|
| 68 | 68 | $_key .= json_encode($this->getTagTokens($widget->cacheTags)); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $_key .= json_encode($arg, JSON_FORCE_OBJECT).app()->getLocale().$form.$widget->template.get_class($widget); |
|
| 71 | + $_key .= json_encode($arg, JSON_FORCE_OBJECT) . app()->getLocale() . $form . $widget->template . get_class($widget); |
|
| 72 | 72 | |
| 73 | 73 | return md5($_key); |
| 74 | 74 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | private function cacheDriverSupportsTags() : bool |
| 81 | 81 | { |
| 82 | - return ! in_array(config('cache.default', 'file'), ['file', 'database']); |
|
| 82 | + return !in_array(config('cache.default', 'file'), ['file', 'database']); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | private function getTagTokens(array $cacheTags) |
| 90 | 90 | { |
| 91 | - return array_map(function ($tag) { |
|
| 91 | + return array_map(function($tag) { |
|
| 92 | 92 | return $this->_cacheTag->getTagToken($tag); |
| 93 | 93 | }, $cacheTags); |
| 94 | 94 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return \Cache::tags($tags)->flush(); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - foreach ((array) $tags as $tag) { |
|
| 106 | + foreach ((array)$tags as $tag) { |
|
| 107 | 107 | $this->_cacheTag->generateNewToken($tag); |
| 108 | 108 | } |
| 109 | 109 | } |