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

ProductBundleFixture   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A configureResourceNode() 0 15 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