BrandFixture::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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