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
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 |