VendorFixture::configureResourceNode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 11
rs 10
c 0
b 0
f 0
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