BlenderFormComposer::compose()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
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