SolarEdgeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace PragmaBroadvertising\SolarEdge;
4
5
use Illuminate\Support\ServiceProvider;
6
use PragmaBroadvertising\SolarEdge\Models\SolarEdge;
7
use PragmaBroadvertising\SolarEdge\Models\SolarEdgeClient;
8
9
class SolarEdgeServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        $this->publishes([
19
            __DIR__ . '/config/main.php' => config_path('laravel-solaredge-api.php')
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            __DIR__ . '/config/main.php' => /** @scrutinizer ignore-call */ config_path('laravel-solaredge-api.php')
Loading history...
20
        ], 'laravel-solaredge-api');
21
    }
22
23
    /**
24
     * Register the application services.
25
     */
26
    public function register()
27
    {
28
        $this->mergeConfigFrom(
29
            __DIR__ . '/config/main.php', 'laravel-solaredge-api'
30
        );
31
32
        $this->app->register('Ixudra\Curl\CurlServiceProvider');
33
34
        $this->app->bind('solaredge', function() {
35
                return new SolarEdge(new SolarEdgeClient());
36
        });
37
    }
38
}
39