Completed
Pull Request — master (#26)
by
unknown
66:17 queued 59:06
created

ProductBundleFixture::configureResourceNode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * Created by solutionDrive GmbH
6
 *
7
 * @copyright 2018 solutionDrive GmbH
8
 */
9
10
namespace solutionDrive\SyliusProductBundlesPlugin\Fixture;
11
12
use Sylius\Bundle\CoreBundle\Fixture\AbstractResourceFixture;
13
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
14
15
class ProductBundleFixture extends AbstractResourceFixture
16
{
17
    public function getName(): string
18
    {
19
        return 'product_bundle';
20
    }
21
22
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
23
    {
24
        $resourceNode
25
            ->children()
26
                ->scalarNode('productCode')->cannotBeEmpty()->end()
27
                ->arrayNode('slots')
28
                    ->prototype('array')
29
                        ->children()
30
                            ->scalarNode('name')->cannotBeEmpty()->end()
31
                            ->arrayNode('productCodes')->prototype('scalar')->end()->end()
32
                            ->arrayNode('options')->prototype('scalar')->end()->end()
33
                        ->end()
34
                    ->end()
35
                ->end();
36
    }
37
}
38