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

SuiteLoader::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 1
cc 2
eloc 3
nc 2
nop 1
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