Passed
Push — master ( bcdbf3...5b3224 )
by Marc
11:54
created

boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace TheCodingMachine\ServerMonitorPluginNotificationByHost;
4
5
use Spatie\Blink\Blink;
6
use Illuminate\Support\ServiceProvider;
7
use TheCodingMachine\ServerMonitorPluginNotificationByHost\Commands\AddNotificationByHost;
8
use TheCodingMachine\ServerMonitorPluginNotificationByHost\Commands\ListNotifications;
9
10
class ServerMonitorPluginNotificationByHostServiceProvider extends ServiceProvider
11
{
12
    public function boot()
13
    {
14
        if ($this->app->runningInConsole()) {
15
            $this->publishes([
16
                __DIR__ . '/../config/server-monitor-plugin-notification-by-host.php' => config_path('server-monitor-plugin-notification-by-host.php'),
17
            ], 'config');
18
19
        }
20
    }
21
22
    public function register()
23
    {
24
        $this->mergeConfigFrom(__DIR__.'/../config/server-monitor-plugin-notification-by-host.php', 'server-monitor-plugin-notification-by-host');
25
26
        $this->app->bind('command.server-monitor:add-notification-host', AddNotificationByHost::class);
27
        $this->app->bind('command.server-monitor:list-notifications', ListNotifications::class);
28
29
        $this->commands([
30
            'command.server-monitor:add-notification-host',
31
            'command.server-monitor:list-notifications',
32
        ]);
33
    }
34
}
35