@@ -90,7 +90,7 @@ |
||
90 | 90 | /** |
91 | 91 | * Get the services provided by the provider. |
92 | 92 | * |
93 | - * @return array |
|
93 | + * @return string[] |
|
94 | 94 | */ |
95 | 95 | public function provides() |
96 | 96 | { |
@@ -21,23 +21,23 @@ discard block |
||
21 | 21 | __DIR__.'/config/config.php', 'laravel-widgets' |
22 | 22 | ); |
23 | 23 | |
24 | - $this->app->bind('arrilot.widget', function () { |
|
24 | + $this->app->bind('arrilot.widget', function() { |
|
25 | 25 | return new WidgetFactory(new LaravelApplicationWrapper()); |
26 | 26 | }); |
27 | 27 | |
28 | - $this->app->bind('arrilot.async-widget', function () { |
|
28 | + $this->app->bind('arrilot.async-widget', function() { |
|
29 | 29 | return new AsyncWidgetFactory(new LaravelApplicationWrapper()); |
30 | 30 | }); |
31 | 31 | |
32 | - $this->app->singleton('arrilot.widget-group-collection', function () { |
|
32 | + $this->app->singleton('arrilot.widget-group-collection', function() { |
|
33 | 33 | return new WidgetGroupCollection(new LaravelApplicationWrapper()); |
34 | 34 | }); |
35 | 35 | |
36 | - $this->app->singleton('arrilot.widget-namespaces', function () { |
|
36 | + $this->app->singleton('arrilot.widget-namespaces', function() { |
|
37 | 37 | return new NamespacesRepository(); |
38 | 38 | }); |
39 | 39 | |
40 | - $this->app->singleton('command.widget.make', function ($app) { |
|
40 | + $this->app->singleton('command.widget.make', function($app) { |
|
41 | 41 | return new WidgetMakeCommand($app['files']); |
42 | 42 | }); |
43 | 43 | |
@@ -66,20 +66,20 @@ discard block |
||
66 | 66 | ]; |
67 | 67 | |
68 | 68 | if (!$this->app->routesAreCached()) { |
69 | - $this->app['router']->group($routeConfig, function ($router) { |
|
69 | + $this->app['router']->group($routeConfig, function($router) { |
|
70 | 70 | $router->get('load-widget', 'WidgetController@showWidget'); |
71 | 71 | }); |
72 | 72 | } |
73 | 73 | |
74 | - Blade::directive('widget', function ($expression) { |
|
74 | + Blade::directive('widget', function($expression) { |
|
75 | 75 | return "<?php echo app('arrilot.widget')->run($expression); ?>"; |
76 | 76 | }); |
77 | 77 | |
78 | - Blade::directive('asyncWidget', function ($expression) { |
|
78 | + Blade::directive('asyncWidget', function($expression) { |
|
79 | 79 | return "<?php echo app('arrilot.async-widget')->run($expression); ?>"; |
80 | 80 | }); |
81 | 81 | |
82 | - Blade::directive('widgetGroup', function ($expression) { |
|
82 | + Blade::directive('widgetGroup', function($expression) { |
|
83 | 83 | return "<?php echo app('arrilot.widget-group-collection')->group($expression)->display(); ?>"; |
84 | 84 | }); |
85 | 85 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * @param $key |
28 | 28 | * @param $minutes |
29 | 29 | * @param $tags |
30 | - * @param callable $callback |
|
30 | + * @param Closure $callback |
|
31 | 31 | * |
32 | 32 | * @return mixed |
33 | 33 | */ |
@@ -67,7 +67,7 @@ |
||
67 | 67 | protected function getContentFromCache($args) |
68 | 68 | { |
69 | 69 | if ($cacheTime = (float) $this->getCacheTime()) { |
70 | - return $this->app->cache($this->widget->cacheKey($args), $cacheTime, $this->widget->cacheTags(), function () { |
|
70 | + return $this->app->cache($this->widget->cacheKey($args), $cacheTime, $this->widget->cacheTags(), function() { |
|
71 | 71 | return $this->getContent(); |
72 | 72 | }); |
73 | 73 | } |
@@ -223,7 +223,7 @@ |
||
223 | 223 | |
224 | 224 | // convert to snake_case part by part to avoid unexpected underscores. |
225 | 225 | $nameArray = explode('/', $name); |
226 | - array_walk($nameArray, function (&$part) { |
|
226 | + array_walk($nameArray, function(&$part) { |
|
227 | 227 | $part = Str::snake($part); |
228 | 228 | }); |
229 | 229 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param string $alias |
20 | 20 | * @param string $namespace |
21 | 21 | * |
22 | - * @return WidgetNamespaces |
|
22 | + * @return NamespacesRepository |
|
23 | 23 | */ |
24 | 24 | public function registerNamespace($alias, $namespace) |
25 | 25 | { |
@@ -31,7 +31,6 @@ discard block |
||
31 | 31 | /** |
32 | 32 | * Get namespace by his alias. |
33 | 33 | * |
34 | - * @param string $label |
|
35 | 34 | * |
36 | 35 | * @throws \Exception |
37 | 36 | * |
@@ -225,7 +225,7 @@ |
||
225 | 225 | public function getWidgetNameWithCustomNamespace() |
226 | 226 | { |
227 | 227 | return $this->customWidgetNamespace |
228 | - ? $this->customWidgetNamespace . '::' . $this->widgetName |
|
228 | + ? $this->customWidgetNamespace.'::'.$this->widgetName |
|
229 | 229 | : $this->widgetName; |
230 | 230 | } |
231 | 231 | } |