DeleteFlowCommandHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Flows\Handler;
4
5
use Hechoenlaravel\JarvisFoundation\Flows\Events\FlowWasDeleted;
6
7
/**
8
 * Class DeleteFlowCommandHandler
9
 * @package Hechoenlaravel\JarvisFoundation\Flows\Handler
10
 */
11
class DeleteFlowCommandHandler
12
{
13
    /**
14
     * @param $command
15
     * @return mixed
16
     */
17
    public function handle($command)
18
    {
19
        $flow = $command->flow->toArray();
20
        $command->flow->delete();
21
        event(new FlowWasDeleted($flow));
22
        return $flow;
23
    }
24
}
25