Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
37 | 29 | public function execute(AbstractParaunitProcess $process) |
|
38 | { |
||
39 | 29 | if (! $this->isFree()) { |
|
40 | 1 | throw new \RuntimeException('This pipeline is not free'); |
|
41 | } |
||
42 | |||
43 | 29 | $this->process = $process; |
|
44 | 29 | $this->process->start($this->number); |
|
45 | |||
46 | 29 | $this->dispatcher->dispatch(ProcessEvent::PROCESS_STARTED, new ProcessEvent($this->process)); |
|
47 | } |
||
48 | |||
89 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: