Passed
Push — master ( ddfabf...6c2ee4 )
by Tom
03:14 queued 10s
created

StancyServiceProvider::registerExporter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
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\ExportFactory as ExportFactoryContract;
6
use Astrotomic\Stancy\Contracts\FeedFactory as FeedFactoryContract;
7
use Astrotomic\Stancy\Contracts\Page as PageContract;
8
use Astrotomic\Stancy\Contracts\PageFactory as PageFactoryContract;
9
use Astrotomic\Stancy\Contracts\SitemapFactory as SitemapFactoryContract;
10
use Astrotomic\Stancy\Factories\ExportFactory;
11
use Astrotomic\Stancy\Factories\FeedFactory;
12
use Astrotomic\Stancy\Factories\PageFactory;
13
use Astrotomic\Stancy\Factories\SitemapFactory;
14
use Astrotomic\Stancy\Models\Page;
15
use Illuminate\Contracts\Support\DeferrableProvider;
16
use Illuminate\Support\ServiceProvider;
17
18
class StancyServiceProvider extends ServiceProvider implements DeferrableProvider
19
{
20 51
    public function register(): void
21
    {
22 51
        $this->registerPage();
23 51
        $this->registerFeed();
24 51
        $this->registerSitemap();
25 51
        $this->registerExporter();
26 51
    }
27
28
    /** @codeCoverageIgnore */
29
    public function provides(): array
0 ignored issues
show
introduced by Gummibeer
Method \Astrotomic\Stancy\StancyServiceProvider::provides() does not have @return annotation for its traversable return value.
Loading history...
introduced by Gummibeer
Method \Astrotomic\Stancy\StancyServiceProvider::provides() does not need documentation comment.
Loading history...
30
    {
31
        return [
32
            PageFactoryContract::class,
33
            PageContract::class,
34
            FeedFactoryContract::class,
35
            ExportFactoryContract::class,
36
            SitemapFactoryContract::class,
37
        ];
38
    }
39
40 51
    protected function registerPage(): void
41
    {
42 51
        $this->app->singleton(PageFactoryContract::class, PageFactory::class);
43 51
        $this->app->bind(PageContract::class, Page::class);
44 51
    }
45
46 51
    protected function registerFeed(): void
47
    {
48 51
        $this->app->singleton(FeedFactoryContract::class, FeedFactory::class);
49 51
    }
50
51 51
    protected function registerSitemap(): void
52
    {
53 51
        $this->app->singleton(SitemapFactoryContract::class, SitemapFactory::class);
54 51
    }
55
56 51
    protected function registerExporter(): void
57
    {
58 51
        $this->app->singleton(ExportFactoryContract::class, ExportFactory::class);
59 51
    }
60
}
61