PDFLayerServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 25
ccs 12
cts 12
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 8 1
A provides() 0 4 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