DeleteFieldCommandHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
4
namespace Hechoenlaravel\JarvisFoundation\FieldGenerator\Handler;
5
6
use Hechoenlaravel\JarvisFoundation\FieldGenerator\FieldModel;
7
use Hechoenlaravel\JarvisFoundation\FieldGenerator\Events\FieldWasDeleted;
8
9
class DeleteFieldCommandHandler
10
{
11
    public function handle($command)
12
    {
13
        $model = FieldModel::find($command->id);
14
        $modelArray = $model->toArray();
15
        $model->delete();
16
        event(new FieldWasDeleted($modelArray));
17
    }
18
}
19