PDFLayerServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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 2
            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 3
    public function provides()
30
    {
31 3
        return ['pdflayer', PDF::class];
32
    }
33
}
34