ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 44
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 7 1
A provides() 0 4 1
1
<?php
2
3
namespace Tylercd100\Placeholders;
4
5
use Illuminate\Support\ServiceProvider as IlluminateProvider;
6
use Tylercd100\Placeholders\Placeholders;
7
8
class ServiceProvider extends IlluminateProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Bootstrap the application events.
19
     *
20
     * @return void
21
     */
22 18
    public function boot()
23
    {
24 18
        $this->publishes([
25 18
            __DIR__ . '/../config/placeholders.php' => base_path('config/placeholders.php'),
26 18
        ]);
27 18
    }
28
29
    /**
30
     * Register the service provider.
31
     *
32
     * @return void
33
     */
34 18
    public function register()
35
    {
36 18
        $this->mergeConfigFrom(__DIR__ . '/../config/placeholders.php', 'placeholders');
37 18
        $this->app->singleton("placeholders", function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38 18
            return new Placeholders(config('placeholders'));
39 18
        });
40 18
    }
41
42
    /**
43
     * Get the services provided by the provider.
44
     *
45
     * @return array
46
     */
47
    public function provides()
48
    {
49
        return ["placeholders"];
50
    }
51
}
52