CreateFlowCommandHandler::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Flows\Handler;
4
5
use Hechoenlaravel\JarvisFoundation\Flows\Flow;
6
use Hechoenlaravel\JarvisFoundation\Flows\Events\FlowWasCreated;
7
8
/**
9
 * Class CreateFlowCommandHandler
10
 * @package Hechoenlaravel\JarvisFoundation\Flows\Handler
11
 */
12
class CreateFlowCommandHandler
13
{
14
    /**
15
     * Create the flow in the database
16
     * @param $command
17
     * @return static
18
     */
19
    public function handle($command)
20
    {
21
        $flow = Flow::create((array)$command);
22
        event(new FlowWasCreated($flow));
23
        return $flow;
24
    }
25
}
26