ZabbixGraphServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 31
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 2
A register() 0 13 1
1
<?php
2
3
namespace CasperBoone\LaravelZabbixGraph;
4
5
use Illuminate\Support\ServiceProvider;
6
use CasperBoone\ZabbixGraph\ZabbixGraph;
7
8
class ZabbixGraphServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13 2
    public function boot()
14
    {
15 2
        if ($this->app->runningInConsole()) {
16 2
            $this->publishes([
17 2
                __DIR__.'/../config/zabbixgraph.php' => config_path('zabbixgraph.php'),
18 2
            ], 'config');
19
        }
20 2
    }
21
22
    /**
23
     * Register the application services.
24
     */
25 2
    public function register()
26
    {
27 2
        $this->mergeConfigFrom(__DIR__.'/../config/zabbixgraph.php', 'zabbixgraph');
28
29 2
        $this->app->bind(ZabbixGraph::class, function () {
30 2
            return new ZabbixGraph(
31 2
                $this->app['config']['zabbixgraph.host'],
32 2
                $this->app['config']['zabbixgraph.username'],
33 2
                $this->app['config']['zabbixgraph.password'],
34 2
                $this->app['config']['zabbixgraph.old_version']
35
            );
36 2
        });
37 2
    }
38
}
39