Passed
Push — master ( 064bed...d815ea )
by Gerrit
04:18
created

AddiksRDMBundle::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 15
rs 10
1
<?php
2
3
namespace Addiks\RDMBundle;
4
5
use Symfony\Component\HttpKernel\Bundle\Bundle;
6
use Psr\Container\ContainerInterface;
7
use Webmozart\Assert\Assert;
8
use Addiks\RDMBundle\DataLoader\DataLoaderInterface;
9
use Doctrine\ORM\EntityManagerInterface;
10
11
class AddiksRDMBundle extends Bundle
12
{
13
    public function boot()
14
    {
15
        Assert::isInstanceOf($this->container, ContainerInterface::class);
16
17
        /** @var DataLoaderInterface $dataLoader */
18
        $dataLoader = $this->container->get('addiks_rdm.data_loader');
19
20
        Assert::isInstanceOf($dataLoader, DataLoaderInterface::class);
21
22
        /** @var EntityManagerInterface $entityManager */
23
        $entityManager = $this->container->get('doctrine.orm.entity_manager');
24
25
        Assert::isInstanceOf($entityManager, EntityManagerInterface::class);
26
27
        $dataLoader->boot($entityManager);
28
    }
29
}
30