LaravelSalesforceServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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