BoletoServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
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
}