Passed
Push — master ( 3e1455...cd0e92 )
by Peter
02:07
created

PageCategoryBootstrapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBindings() 0 9 1
A getBindings() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Bootstrappers\Template\Loader;
6
7
use AbterPhp\Website\Databases\Queries\PageCategoryCache as Cache;
8
use AbterPhp\Website\Orm\PageRepo as Repo;
9
use AbterPhp\Website\Template\Builder\PageCategory as Builder;
10
use AbterPhp\Website\Template\Loader\PageCategory as Loader;
11
use Opulence\Ioc\Bootstrappers\Bootstrapper;
12
use Opulence\Ioc\Bootstrappers\ILazyBootstrapper;
13
use Opulence\Ioc\IContainer;
14
15
class PageCategoryBootstrapper extends Bootstrapper implements ILazyBootstrapper
16
{
17
    /**
18
     * @return array
19
     */
20
    public function getBindings(): array
21
    {
22
        return [
23
            Loader::class,
24
        ];
25
    }
26
27
    /**
28
     * @param IContainer $container
29
     */
30
    public function registerBindings(IContainer $container)
31
    {
32
        $cache   = $container->resolve(Cache::class);
33
        $repo    = $container->resolve(Repo::class);
34
        $builder = $container->resolve(Builder::class);
35
36
        $loader = new Loader($repo, $cache, $builder);
37
38
        $container->bindInstance(Loader::class, $loader);
39
    }
40
}
41