Skip to content

Commit 4306bfe

Browse files
committed
Clean up code
1 parent 8dfed6c commit 4306bfe

File tree

2 files changed

+8
-32
lines changed

2 files changed

+8
-32
lines changed

src/BeanstalkdUIServiceProvider.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010

1111
class BeanstalkdUIServiceProvider extends ServiceProvider
1212
{
13-
/**
14-
* Register the service provider.
15-
*/
16-
public function register()
13+
public function register(): void
1714
{
1815
$this->mergeConfigFrom(__DIR__.'/Resources/config/beanstalkdui.php', 'beanstalkdui');
1916

@@ -25,35 +22,27 @@ public function register()
2522
});
2623
}
2724

28-
/**
29-
* Perform post-registration booting of services.
30-
*
31-
* @param Router $router
32-
*/
33-
public function boot(Router $router)
25+
public function boot(Router $router): void
3426
{
3527
$this->publishAssets();
3628
$this->registerRoutes($router);
3729
$this->loadViewsFrom(__DIR__.'/Resources/views', 'beanstalkdui');
3830
$this->registerViewComposer();
3931
}
4032

41-
/**
42-
* @param Router $router
43-
*/
44-
private function registerRoutes(Router $router)
33+
private function registerRoutes(Router $router): void
4534
{
4635
if (!$this->app->routesAreCached()) {
4736
$router->group([
4837
'middleware' => config('beanstalkdui.middleware'),
4938
'prefix' => config('beanstalkdui.prefix')
50-
], function ($router) {
39+
], function () {
5140
require __DIR__.'/routes.php';
5241
});
5342
}
5443
}
5544

56-
private function publishAssets()
45+
private function publishAssets(): void
5746
{
5847
$this->publishes([
5948
__DIR__.'/Resources/assets/css' => public_path('vendor/beanstalkdui/css'),
@@ -70,7 +59,7 @@ private function publishAssets()
7059
]);
7160
}
7261

73-
private function registerViewComposer()
62+
private function registerViewComposer(): void
7463
{
7564
view()->composer('beanstalkdui::partials.sidenav', LayoutComposer::class);
7665
}

src/ViewComposers/LayoutComposer.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,14 @@
77

88
class LayoutComposer
99
{
10-
/**
11-
* @var PheanstalkInterface
12-
*/
13-
private $pheanstalk;
10+
private PheanstalkInterface $pheanstalk;
1411

15-
/**
16-
* LayoutComposer constructor.
17-
*
18-
* @param PheanstalkInterface $pheanstalk
19-
*/
2012
public function __construct(PheanstalkInterface $pheanstalk)
2113
{
2214
$this->pheanstalk = $pheanstalk;
2315
}
2416

25-
/**
26-
* Bind data to the view.
27-
*
28-
* @param View $view
29-
*/
30-
public function compose(View $view)
17+
public function compose(View $view): void
3118
{
3219
$view->with('tubes', $this->pheanstalk->listTubes());
3320
}

0 commit comments

Comments
 (0)