Completed
Push — master ( 0b105d...2d000c )
by Tom
03:34
created

StancyServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 11
c 0
b 0
f 0
dl 0
loc 31
ccs 19
cts 19
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A registerSchemaOrg() 0 3 1
A register() 0 5 1
A boot() 0 5 1
A registerConfig() 0 4 1
A registerPage() 0 3 1
1
<?php
2
3
namespace Astrotomic\Stancy;
4
5
use Astrotomic\Stancy\Models\Page;
6
use Illuminate\Support\ServiceProvider;
7
use Spatie\SchemaOrg\Graph;
8
9
class StancyServiceProvider extends ServiceProvider
10
{
11 13
    public function boot(): void
12
    {
13 13
        $this->publishes([
14 13
            __DIR__.'/../config/stancy.php' => config_path('stancy.php'),
15 13
        ], 'config');
16 13
    }
17
18 13
    public function register(): void
19
    {
20 13
        $this->registerConfig();
21 13
        $this->registerSchemaOrg();
22 13
        $this->registerPage();
23 13
    }
24
25 13
    protected function registerConfig(): void
26
    {
27 13
        $this->mergeConfigFrom(
28 13
            __DIR__.'/../config/stancy.php', 'stancy'
29
        );
30 13
    }
31
32 13
    protected function registerSchemaOrg(): void
33
    {
34 13
        $this->app->singleton(Graph::class);
35 13
    }
36
37 13
    protected function registerPage(): void
38
    {
39 13
        $this->app->bind(Page::class);
40 13
    }
41
}
42