Completed
Push — master ( 09ebf3...a2507a )
by Joachim
10s
created

BrandFixture   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureResourceNode() 0 9 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
final class BrandFixture extends AbstractResourceFixture
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getName(): string
16
    {
17
        return 'loevgaard_sylius_brand_plugin_brand';
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
24
    {
25
        $resourceNode
26
            ->children()
27
                ->scalarNode('name')->cannotBeEmpty()->end()
28
                ->scalarNode('slug')->cannotBeEmpty()->end()
0 ignored issues
show
Bug introduced by
The method scalarNode() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
                ->/** @scrutinizer ignore-call */ scalarNode('slug')->cannotBeEmpty()->end()
Loading history...
29
                ->arrayNode('products')
30
                    ->scalarPrototype()->end()
31
                ->end();
32
    }
33
}
34