BoletoServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 1
A register() 0 5 1
A registerBoletosManager() 0 4 1
A registerBindings() 0 17 1
1
<?php
2
3
namespace CbCaio\Boletos\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class BoletoServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Indicates if loading of the provider is deferred.
11
     *
12
     * @var bool
13
     */
14
    protected $defer = FALSE;
15
16
    /**
17
     * Perform post-registration booting of services.
18
     *
19
     * @return void
20
     */
21
    public function boot()
22
    {
23
        $this->publishes(
24
            [
25
                __DIR__ . '/../../resources/config/boletos.php'
26
                => config_path('boletos.php'),
27
            ]
28
        );
29
30
        $this->mergeConfigFrom(
31
            __DIR__ . '/../../resources/config/boletos.php', 'boletos'
32
        );
33
    }
34
35
    /**
36
     * Register any package services.
37
     *
38
     * @return void
39
     */
40
    public function register()
41
    {
42
        $this->registerBindings();
43
        $this->registerBoletosManager();
44
    }
45
46
    private function registerBoletosManager()
47
    {
48
        $this->app->singleton('BoletoCEF', 'CbCaio\Boletos\Models\Boleto\CaixaEconomicaFederal');
49
    }
50
51
    private function registerBindings()
52
    {
53
        $this->app->bind('CbCaio\Boletos\Models\Banco\Contracts\BancoInterface',
54
                         'CbCaio\Boletos\Models\Banco\Base\Banco');
55
56
        $this->app->bind('CbCaio\Boletos\Models\Beneficiario\Contracts\BeneficiarioInterface',
57
                         'CbCaio\Boletos\Models\Beneficiario\Base\Beneficiario');
58
59
        $this->app->bind('CbCaio\Boletos\Models\Boleto\Contracts\BoletoInterface',
60
                         'CbCaio\Boletos\Models\Boleto\Base\Boleto');
61
62
        $this->app->bind('CbCaio\Boletos\Models\BoletoInfo\Contracts\BoletoInfoInterface',
63
                         'CbCaio\Boletos\Models\BoletoInfo\BoletoInfo');
64
65
        $this->app->bind('CbCaio\Boletos\Models\Pagador\Contracts\PagadorInterface',
66
                         'CbCaio\Boletos\Models\Pagador\Pagador');
67
    }
68
}