VendorFixture   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureResourceNode() 0 11 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusVendorPlugin\Fixture;
6
7
use Sylius\Bundle\CoreBundle\Fixture\AbstractResourceFixture;
8
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
9
10
class VendorFixture extends AbstractResourceFixture
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
16
    {
17
        $node = $resourceNode->children();
18
19
        $node->arrayNode('products')->scalarPrototype();
20
        $node->arrayNode('channels')->scalarPrototype();
21
        $node->scalarNode('name')->cannotBeEmpty();
22
        $node->scalarNode('slug')->cannotBeEmpty();
23
        $node->scalarNode('email')->cannotBeEmpty();
24
        $node->scalarNode('logo');
25
        $node->scalarNode('description');
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getName(): string
32
    {
33
        return 'vendor';
34
    }
35
}
36