Passed
Push — master ( ad6b2a...b41ca0 )
by Caen
07:45 queued 14s
created

NavigationServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Foundation\Providers;
6
7
use Hyde\Foundation\HydeKernel;
8
use Illuminate\Support\ServiceProvider;
9
use Hyde\Framework\Features\Navigation\MainNavigationMenu;
10
use Hyde\Framework\Features\Navigation\DocumentationSidebar;
11
use Hyde\Framework\Features\Navigation\NavigationMenuGenerator;
12
13
class NavigationServiceProvider extends ServiceProvider
14
{
15
    public function register(): void
16
    {
17
        $this->app->make(HydeKernel::class)->booted(function (): void {
18
            $this->app->singleton('navigation.main', function (): MainNavigationMenu {
19
                return NavigationMenuGenerator::handle(MainNavigationMenu::class);
20
            });
21
22
            $this->app->singleton('navigation.sidebar', function (): DocumentationSidebar {
23
                return NavigationMenuGenerator::handle(DocumentationSidebar::class);
24
            });
25
        });
26
    }
27
}
28