AbstractFixtures   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFixturesDir() 0 3 1
A getLoader() 0 3 1
A __construct() 0 3 1
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