@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | { |
31 | 31 | $tpl = $this->widget->template; |
32 | 32 | if (str_contains($tpl, 'Widgets::')) { |
33 | - $tpl = str_replace('Widgets::', app()->getNamespace().'Widgets\\', $tpl); |
|
33 | + $tpl = str_replace('Widgets::', app()->getNamespace() . 'Widgets\\', $tpl); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $tpl = str_replace('.', '\\', $tpl); |
37 | 37 | |
38 | - $this->html = "<span title='WidgetObj : ".get_class($this->widget).".php
Template : {$tpl}.blade.php{$this->cacheState()}>{$this->html}</span>"; |
|
38 | + $this->html = "<span title='WidgetObj : " . get_class($this->widget) . ".php
Template : {$tpl}.blade.php{$this->cacheState()}>{$this->html}</span>"; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function cacheState() |
46 | 46 | { |
47 | - if (! $this->policies->widgetShouldUseCache()) { |
|
47 | + if (!$this->policies->widgetShouldUseCache()) { |
|
48 | 48 | return ' 
Cache: is globally turned off (You should put "WIDGET_CACHE=true" in .env) '; |
49 | 49 | } |
50 | 50 | |
@@ -53,6 +53,6 @@ discard block |
||
53 | 53 | |
54 | 54 | private function addHtmlComments() |
55 | 55 | { |
56 | - $this->html = "<!-- '{".get_class($this->widget)."' Widget Start -->".$this->html."<!-- '".get_class($this->widget)."' Widget End -->"; |
|
56 | + $this->html = "<!-- '{" . get_class($this->widget) . "' Widget Start -->" . $this->html . "<!-- '" . get_class($this->widget) . "' Widget End -->"; |
|
57 | 57 | } |
58 | 58 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function boot() |
21 | 21 | { |
22 | 22 | $this->_defineDirectives(); |
23 | - $this->loadViewsFrom($this->app->basePath().'/app/Widgets/', 'Widgets'); |
|
23 | + $this->loadViewsFrom($this->app->basePath() . '/app/Widgets/', 'Widgets'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function register() |
32 | 32 | { |
33 | - $this->app->singleton('command.imanghafoori.widget', function ($app) { |
|
33 | + $this->app->singleton('command.imanghafoori.widget', function($app) { |
|
34 | 34 | return $app['Imanghafoori\Widgets\WidgetGenerator']; |
35 | 35 | }); |
36 | 36 | |
37 | - $this->app->singleton(Normalizer::class, function () { |
|
37 | + $this->app->singleton(Normalizer::class, function() { |
|
38 | 38 | $cacheNormalizer = new CacheNormalizer(); |
39 | 39 | $templateNormalizer = new TemplateNormalizer(); |
40 | 40 | $presenterNormalizer = new PresenterNormalizer(); |
@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | return new Utils\Normalizer($templateNormalizer, $cacheNormalizer, $presenterNormalizer, $controllerNormalizer); |
44 | 44 | }); |
45 | 45 | |
46 | - $this->app->singleton(Utils\HtmlMinifier::class, function () { |
|
46 | + $this->app->singleton(Utils\HtmlMinifier::class, function() { |
|
47 | 47 | return new Utils\HtmlMinifier(); |
48 | 48 | }); |
49 | 49 | |
50 | - $this->app->singleton(Utils\DebugInfo::class, function () { |
|
50 | + $this->app->singleton(Utils\DebugInfo::class, function() { |
|
51 | 51 | return new Utils\DebugInfo(); |
52 | 52 | }); |
53 | 53 | |
54 | - $this->app->singleton(Utils\Policies::class, function () { |
|
54 | + $this->app->singleton(Utils\Policies::class, function() { |
|
55 | 55 | return new Utils\Policies(); |
56 | 56 | }); |
57 | 57 | |
58 | - $this->app->singleton(Utils\Cache::class, function () { |
|
58 | + $this->app->singleton(Utils\Cache::class, function() { |
|
59 | 59 | return new Utils\Cache(); |
60 | 60 | }); |
61 | 61 | |
62 | - $this->app->singleton(Utils\WidgetRenderer::class, function () { |
|
62 | + $this->app->singleton(Utils\WidgetRenderer::class, function() { |
|
63 | 63 | return new Utils\WidgetRenderer(); |
64 | 64 | }); |
65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $omitParenthesis = version_compare($this->app->version(), '5.3', '<'); |
75 | 75 | |
76 | - Blade::directive('widget', function ($expression) use ($omitParenthesis) { |
|
76 | + Blade::directive('widget', function($expression) use ($omitParenthesis) { |
|
77 | 77 | $expression = $omitParenthesis ? $expression : "($expression)"; |
78 | 78 | |
79 | 79 | return "<?php echo app(\\Imanghafoori\\Widgets\\Utils\\WidgetRenderer::class)->renderWidget{$expression}; ?>"; |