Completed
Push — master ( 0002c8...bd98b1 )
by Mathieu
05:01 queued 01:49
created

PDFLayerServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace MathieuTu\PDFLayer;
4
5
use GuzzleHttp\Client;
6
use Illuminate\Foundation\Application;
7
use Illuminate\Support\ServiceProvider;
8
9
class PDFLayerServiceProvider extends ServiceProvider
10
{
11
    protected $defer = true;
12
13 14
    public function boot()
14
    {
15 14
        $configPath = __DIR__ . '/../config/';
16 14
        $this->mergeConfigFrom($configPath . 'pdflayer.php', 'pdflayer');
17 14
        $this->publishes([$configPath => config_path()], 'config');
18 14
    }
19
20
    public function register()
21
    {
22 14
        $this->app->bind('pdflayer', function (Application $app) {
23 1
            return new PDF($app->make(Client::class), $app['config'], $app['files'], $app['view']);
24 14
        });
25
26 14
        $this->app->alias('pdflayer', PDF::class);
27 14
    }
28
29
    public function provides()
30
    {
31
        return ['pdflayer', PDF::class];
32
    }
33
}
34