@@ -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 | { |
@@ -24,19 +24,19 @@ discard block |
||
| 24 | 24 | __DIR__.'/config/config.php', 'laravel-widgets' |
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | - $this->app->bind('arrilot.widget', function () { |
|
| 27 | + $this->app->bind('arrilot.widget', function() { |
|
| 28 | 28 | return new WidgetFactory(new LaravelApplicationWrapper()); |
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | - $this->app->bind('arrilot.async-widget', function () { |
|
| 31 | + $this->app->bind('arrilot.async-widget', function() { |
|
| 32 | 32 | return new AsyncWidgetFactory(new LaravelApplicationWrapper()); |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - $this->app->singleton('arrilot.widget-group-collection', function () { |
|
| 35 | + $this->app->singleton('arrilot.widget-group-collection', function() { |
|
| 36 | 36 | return new WidgetGroupCollection(new LaravelApplicationWrapper()); |
| 37 | 37 | }); |
| 38 | 38 | |
| 39 | - $this->app->singleton('command.widget.make', function ($app) { |
|
| 39 | + $this->app->singleton('command.widget.make', function($app) { |
|
| 40 | 40 | return new WidgetMakeCommand($app['files']); |
| 41 | 41 | }); |
| 42 | 42 | |
@@ -65,26 +65,26 @@ discard block |
||
| 65 | 65 | ]; |
| 66 | 66 | |
| 67 | 67 | if (!$this->app->routesAreCached()) { |
| 68 | - $this->app['router']->group($routeConfig, function ($router) { |
|
| 68 | + $this->app['router']->group($routeConfig, function($router) { |
|
| 69 | 69 | $router->get('load-widget', 'WidgetController@showWidget'); |
| 70 | 70 | }); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $omitParenthesis = version_compare($this->app->version(), '5.3', '<'); |
| 74 | 74 | |
| 75 | - Blade::directive('widget', function ($expression) use ($omitParenthesis) { |
|
| 75 | + Blade::directive('widget', function($expression) use ($omitParenthesis) { |
|
| 76 | 76 | $expression = $omitParenthesis ? $expression : "($expression)"; |
| 77 | 77 | |
| 78 | 78 | return "<?php echo app('arrilot.widget')->run{$expression}; ?>"; |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | - Blade::directive('asyncWidget', function ($expression) use ($omitParenthesis) { |
|
| 81 | + Blade::directive('asyncWidget', function($expression) use ($omitParenthesis) { |
|
| 82 | 82 | $expression = $omitParenthesis ? $expression : "($expression)"; |
| 83 | 83 | |
| 84 | 84 | return "<?php echo app('arrilot.async-widget')->run{$expression}; ?>"; |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | - Blade::directive('widgetGroup', function ($expression) use ($omitParenthesis) { |
|
| 87 | + Blade::directive('widgetGroup', function($expression) use ($omitParenthesis) { |
|
| 88 | 88 | $expression = $omitParenthesis ? $expression : "($expression)"; |
| 89 | 89 | |
| 90 | 90 | return "<?php echo app('arrilot.widget-group-collection')->group{$expression}->display(); ?>"; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * |
| 27 | 27 | * @param $key |
| 28 | 28 | * @param $minutes |
| 29 | - * @param callable $callback |
|
| 29 | + * @param Closure $callback |
|
| 30 | 30 | * |
| 31 | 31 | * @return mixed |
| 32 | 32 | */ |
@@ -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, function () { |
|
| 70 | + return $this->app->cache($this->widget->cacheKey($args), $cacheTime, function() { |
|
| 71 | 71 | return $this->getContent(); |
| 72 | 72 | }); |
| 73 | 73 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | protected function getDefaultNamespace($rootNamespace) |
| 143 | 143 | { |
| 144 | - $namespace = config('laravel-widgets.default_namespace', $rootNamespace.'\Widgets'); |
|
| 144 | + $namespace = config('laravel-widgets.default_namespace', $rootNamespace.'\Widgets'); |
|
| 145 | 145 | |
| 146 | 146 | if (!Str::startsWith($namespace, $rootNamespace)) { |
| 147 | 147 | throw new RuntimeException("You can not use the generator if the default namespace ($namespace) does not start with application namespace ($rootNamespace)"); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | // convert to snake_case part by part to avoid unexpected underscores. |
| 206 | 206 | $nameArray = explode('/', $name); |
| 207 | - array_walk($nameArray, function (&$part) { |
|
| 207 | + array_walk($nameArray, function(&$part) { |
|
| 208 | 208 | $part = snake_case($part); |
| 209 | 209 | }); |
| 210 | 210 | |