AbstractFixtures::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Smart\AuthenticationBundle\DataFixtures;
4
5
use Doctrine\Bundle\FixturesBundle\Fixture;
6
use Fidry\AliceDataFixtures\Loader\PurgerLoader;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
/**
10
 * Nicolas Bastien <[email protected]>
11
 */
12
abstract class AbstractFixtures extends Fixture
13
{
14
    /**
15
     * @var ContainerInterface
16
     */
17
    protected $container;
18
19
    /**
20
     * @var string
21
     */
22
    protected $fixturesDir;
23
24
    /**
25
     * @param ContainerInterface $container
26
     */
27
    public function __construct(ContainerInterface $container)
28
    {
29
        $this->container = $container;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    protected function getFixturesDir()
36
    {
37
        return $this->container->getParameter('kernel.project_dir') . '/fixtures/';
38
    }
39
40
    /**
41
     * @return PurgerLoader
42
     */
43
    protected function getLoader()
44
    {
45
        return $this->container->get('fidry_alice_data_fixtures.loader.doctrine');
46
    }
47
}
48