Passed
Push — master ( f5217d...111314 )
by Tom
03:09
created

StancyServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 3
c 2
b 0
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Astrotomic\Stancy;
4
5
use Astrotomic\Stancy\Contracts\FeedFactory as FeedFactoryContract;
6
use Astrotomic\Stancy\Contracts\Page as PageContract;
7
use Astrotomic\Stancy\Contracts\PageFactory as PageFactoryContract;
8
use Astrotomic\Stancy\Contracts\SitemapFactory as SitemapFactoryContract;
9
use Astrotomic\Stancy\Factories\FeedFactory;
10
use Astrotomic\Stancy\Factories\PageFactory;
11
use Astrotomic\Stancy\Factories\SitemapFactory;
12
use Astrotomic\Stancy\Models\Page;
13
use Illuminate\Contracts\Support\DeferrableProvider;
14
use Illuminate\Support\ServiceProvider;
15
16
class StancyServiceProvider extends ServiceProvider implements DeferrableProvider
17
{
18 44
    public function register(): void
19
    {
20 44
        $this->registerPage();
21 44
        $this->registerFeed();
22 44
        $this->registerSitemap();
23 44
    }
24
25 1
    public function provides(): array
0 ignored issues
show
introduced by
Method \Astrotomic\Stancy\StancyServiceProvider::provides() does not have @return annotation for its traversable return value.
Loading history...
26
    {
27
        return [
28 1
            PageFactoryContract::class,
29
            PageContract::class,
30
            FeedFactoryContract::class,
31
            SitemapFactoryContract::class,
32
        ];
33
    }
34
35 44
    protected function registerPage(): void
36
    {
37 44
        $this->app->singleton(PageFactoryContract::class, PageFactory::class);
38 44
        $this->app->bind(PageContract::class, Page::class);
39 44
    }
40
41 44
    protected function registerFeed(): void
42
    {
43 44
        $this->app->singleton(FeedFactoryContract::class, FeedFactory::class);
44 44
    }
45
46 44
    protected function registerSitemap(): void
47
    {
48 44
        $this->app->singleton(SitemapFactoryContract::class, SitemapFactory::class);
49 44
    }
50
}
51