PredefinedDataStep   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A describe() 0 3 1
A execute() 0 4 1
A configureOptionResolver() 0 6 1
1
<?php
2
3
namespace Darkilliant\ProcessBundle\Step;
4
5
use Symfony\Component\OptionsResolver\OptionsResolver;
6
use Darkilliant\ProcessBundle\State\ProcessState;
7
8
class PredefinedDataStep extends AbstractConfigurableStep
9
{
10 8
    public function configureOptionResolver(OptionsResolver $resolver): OptionsResolver
11
    {
12
        $resolver
13 8
            ->setRequired('data');
14
15 8
        return parent::configureOptionResolver($resolver);
16
    }
17
18 5
    public function execute(ProcessState $state)
19
    {
20 5
        $state->setData($state->getOptions()['data'] ?? null);
21 5
        $this->describe($state);
22 5
    }
23
24 7
    public function describe(ProcessState $state)
25
    {
26 7
        $state->info('use predefined data for debug', ['data' => $state->getData()]);
27 7
    }
28
}
29