ScheduleFixture   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A configureResourceNode() 0 18 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusSchedulerPlugin\Fixture;
6
7
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8
9
final class ScheduleFixture extends AbstractResourceFixture
10
{
11
    /**
12
     * @return string
13
     */
14
    public function getName(): string
15
    {
16
        return 'setono_scheduler_schedule';
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
23
    {
24
        $resourceNode
25
            ->children()
26
                ->scalarNode('code')->cannotBeEmpty()->end()
27
                ->scalarNode('name')->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

27
                ->/** @scrutinizer ignore-call */ scalarNode('name')->end()
Loading history...
28
                ->scalarNode('command')->cannotBeEmpty()->end()
29
                ->arrayNode('args')
30
                    ->requiresAtLeastOneElement()
31
                    ->treatNullLike([])
32
                    ->beforeNormalization()->castToArray()->end()
33
                    ->scalarPrototype()->cannotBeEmpty()->end()
34
                ->end()
35
                ->scalarNode('queue')->cannotBeEmpty()->end()
36
                ->scalarNode('priority')->cannotBeEmpty()->end()
37
                ->scalarNode('created_at')->cannotBeEmpty()->end()
38
                ->scalarNode('cron_expression')->cannotBeEmpty()->end()
39
            ->end()
40
        ;
41
    }
42
}
43