ProductBundleFixture   A
last analyzed

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