Completed
Push — master ( 4c7b9c...e919dc )
by Kamil
21:11
created

SuiteLoader   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 29
rs 10
c 2
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A load() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\FixturesBundle\Loader;
13
14
use Sylius\Bundle\FixturesBundle\Fixture\FixtureInterface;
15
use Sylius\Bundle\FixturesBundle\Suite\SuiteInterface;
16
17
/**
18
 * @author Kamil Kokot <[email protected]>
19
 */
20
final class SuiteLoader implements SuiteLoaderInterface
21
{
22
    /**
23
     * @var FixtureLoaderInterface
24
     */
25
    private $fixtureLoader;
26
27
    /**
28
     * @param FixtureLoaderInterface $fixtureLoader
29
     */
30
    public function __construct(FixtureLoaderInterface $fixtureLoader)
31
    {
32
        $this->fixtureLoader = $fixtureLoader;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function load(SuiteInterface $suite)
39
    {
40
        /**
41
         * @var FixtureInterface $fixture
42
         * @var array $fixtureOptions
43
         */
44
        foreach ($suite->getFixtures() as $fixture => $fixtureOptions) {
45
            $this->fixtureLoader->load($suite, $fixture, $fixtureOptions);
46
        }
47
    }
48
}
49