Completed
Push — master ( ec3f5a...4ff794 )
by Tom
03:20
created

StancyServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 5
eloc 11
c 2
b 0
f 2
dl 0
loc 31
rs 10

5 Methods

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