Completed
Push — master ( 3ef484...ea5778 )
by Paweł
08:46
created

LoadPackagesData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 16 2
A getOrder() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Bundle\FixturesBundle\DataFixtures\ORM;
6
7
use Doctrine\Common\DataFixtures\FixtureInterface;
8
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
9
use Doctrine\Common\Persistence\ObjectManager;
10
use SWP\Bundle\FixturesBundle\AbstractFixture;
11
12
class LoadPackagesData extends AbstractFixture implements FixtureInterface, OrderedFixtureInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function load(ObjectManager $manager)
18
    {
19
        $env = $this->getEnvironment();
20
21
        if ('test' === $env) {
22
            $this->loadFixtures(
23
                [
24
                    '@SWPFixturesBundle/Resources/fixtures/ORM/'.$env.'/package.yml',
25
                ],
26
                $manager,
27
                [
28
                    'providers' => [$this],
29
                ]
30
            );
31
        }
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getOrder()
38
    {
39
        return 6;
40
    }
41
}
42