LaunchProcessStep::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
ccs 4
cts 4
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 LaunchProcessStep extends AbstractConfigurableStep
9
{
10 2
    public function execute(ProcessState $state)
11
    {
12 2
        $state->info('launch process {process}', ['process' => $state->getOptions()['process']]);
13
14 2
        $process = $state->getStepRunner()->buildConfigurationProcess($state->getOptions()['process']);
15
16 2
        $state->getStepRunner()->run($process, $state->getOptions()['context'], $state->isDryRun());
17 2
    }
18
19 2
    public function configureOptionResolver(OptionsResolver $resolver): OptionsResolver
20
    {
21 2
        $resolver->setRequired(['process']);
22 2
        $resolver->setDefault('context', []);
23
24 2
        return parent::configureOptionResolver($resolver);
25
    }
26
}
27