DeleteStepCommandHandler::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Flows\Handler;
4
5
use Hechoenlaravel\JarvisFoundation\Flows\Events\StepWasDeleted;
6
7
/**
8
 * Class DeleteStepCommandHandler
9
 * @package Hechoenlaravel\JarvisFoundation\Flows\Handler
10
 */
11
class DeleteStepCommandHandler
12
{
13
    /**
14
     * @param $command
15
     * @return mixed
16
     */
17
    public function handle($command)
18
    {
19
        $step = $command->step->toArray();
20
        $command->step->delete();
21
        event(new StepWasDeleted($step));
22
        return $step;
23
    }
24
}
25