PredefinedDataStep::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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