SetFieldTypeOnEdit   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 6 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\FieldGenerator\Middleware;
4
5
use League\Tactician\Middleware;
6
use Hechoenlaravel\JarvisFoundation\FieldGenerator\FieldModel;
7
8
class SetFieldTypeOnEdit implements Middleware
9
{
10
    /**
11
     * @param object $command
12
     * @param callable $next
13
     *
14
     * @return mixed
15
     */
16
    public function execute($command, callable $next)
17
    {
18
        $field = FieldModel::find($command->id);
19
        $command->type = $field->type;
20
        return $next($command);
21
    }
22
}
23