BlenderFormComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 10 2
1
<?php
2
3
namespace App\Http\ViewComposers\Back;
4
5
use Illuminate\Contracts\View\View;
6
use function spatie\array_keys_exist;
7
use App\Services\Html\BlenderFormBuilder;
8
9
class BlenderFormComposer
10
{
11
    public function compose(View $view)
12
    {
13
        $viewData = $view->getData();
14
15
        if (! array_keys_exist(['module', 'model', 'errors'], $viewData)) {
16
            return;
17
        }
18
19
        app(BlenderFormBuilder::class)->init($viewData['module'], $viewData['model'], $viewData['errors']);
20
    }
21
}
22