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

StancyServiceProvider::registerSchemaOrg()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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