BrandFixture   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureResourceNode() 0 7 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Loevgaard\SyliusBrandPlugin\Fixture;
6
7
use Sylius\Bundle\CoreBundle\Fixture\AbstractResourceFixture;
8
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
9
10
class BrandFixture extends AbstractResourceFixture
11
{
12
    public function getName(): string
13
    {
14
        return 'loevgaard_sylius_brand_plugin_brand';
15
    }
16
17
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
18
    {
19
        $node = $resourceNode->children();
20
        $node->scalarNode('name')->cannotBeEmpty();
21
        $node->scalarNode('code')->cannotBeEmpty();
22
        $node->arrayNode('images')->variablePrototype();
23
        $node->arrayNode('products')->scalarPrototype();
24
    }
25
}
26