Passed
Push — master ( 31e78a...d45005 )
by Toby
02:25
created

UnionCloudServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Service provider for UnionCloud
4
 */
5
6
namespace Twigger\UnionCloud\API;
7
8
use Illuminate\Support\ServiceProvider;
9
10
11
/**
12
 * Allow Laravel to use UnionCloud
13
 * Class UnionCloudServiceProvider
14
 *
15
 * @package Twigger\UnionCloud\API\Laravel
16
 */
17
class UnionCloudServiceProvider extends ServiceProvider
18
{
19
20
    /**
21
     * Indicates if loading of the provider is deferred.
22
     *
23
     * @var bool
24
     */
25
    protected $defer = false;
26
27
    /**
28
     * Bootstrap the application events.
29
     *
30
     * @return void
31
     */
32
    public function boot()
33
    {
34
        $this->publishes([
35
            __DIR__.'/../publish/config/unioncloud.php' => config_path('unioncloud.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

35
            __DIR__.'/../publish/config/unioncloud.php' => /** @scrutinizer ignore-call */ config_path('unioncloud.php'),
Loading history...
36
        ], 'configtest');
37
38
    }
39
40
    /**
41
     * Register the service provider.
42
     *
43
     * @return void
44
     */
45
    public function register()
46
    {
47
48
        $this->app->singleton('Twigger\UnionCloud\API\UnionCloud', function($app){
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

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

48
        $this->app->singleton('Twigger\UnionCloud\API\UnionCloud', function(/** @scrutinizer ignore-unused */ $app){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
49
            $unionCloud = new UnionCloud([
50
                'email' => config('unioncloud.v0auth.email', 'email'),
0 ignored issues
show
Bug introduced by
The function config 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

50
                'email' => /** @scrutinizer ignore-call */ config('unioncloud.v0auth.email', 'email'),
Loading history...
51
                'password' => config('unioncloud.v0auth.password', 'password'),
52
                'appID' => config('unioncloud.v0auth.appID', 'appID'),
53
                'appPassword' => config('unioncloud.v0auth.appPassword', 'appPassword'),
54
            ]);
55
            $unionCloud->setBaseURL(config('unioncloud.baseURL', 'union.unioncloud.org'));
56
            return $unionCloud;
57
        });
58
    }
59
60
}