LaravelSalesforceServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 45
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 9 1
A provides() 0 4 1
1
<?php
2
namespace Davispeixoto\LaravelSalesforce;
3
4
use Illuminate\Support\ServiceProvider;
5
use Davispeixoto\ForceDotComToolkitForPhp\SforceEnterpriseClient as Client;
6
7
/**
8
 * Class LaravelSalesforceServiceProvider
9
 * @package Davispeixoto\LaravelSalesforce
10
 */
11
class LaravelSalesforceServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Indicates if loading of the provider is deferred.
15
     *
16
     * @var bool
17
     */
18
    protected $defer = true;
19
20
    /**
21
     * Bootstrap the application events.
22
     *
23
     * @return void
24
     */
25
    public function boot()
26
    {
27
        $this->package('davispeixoto/laravel-salesforce');
28
    }
29
30
    /**
31
     * Register the service provider.
32
     *
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        $this->app->singleton('salesforce', function ($app) {
38
            $sf = new Salesforce(new Client());
39
            $sf->connect($app['config']);
40
41
            return $sf;
42
        });
43
    }
44
45
    /**
46
     * Get the services provided by the provider.
47
     *
48
     * @return array
49
     */
50
    public function provides()
51
    {
52
        return array('salesforce');
53
    }
54
55
}
56