EntityGeneratorHandler   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 6 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\EntityGenerator\Handler;
4
5
use Hechoenlaravel\JarvisFoundation\EntityGenerator\EntityModel;
6
use Hechoenlaravel\JarvisFoundation\EntityGenerator\Events\EntityWasCreated;
7
8
/**
9
 * Class EntityGeneratorHandler
10
 * @package Hechoenlaravel\JarvisFoundation\EntityGenerator\Handler
11
 */
12
class EntityGeneratorHandler
13
{
14
    /**
15
     * Creates the Entity Record
16
     * @param $command
17
     * @return static
18
     */
19
    public function handle($command)
20
    {
21
        $entity = EntityModel::create((array) $command);
22
        event(new EntityWasCreated($entity));
23
        return $entity;
24
    }
25
}
26