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

PDFLayerServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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