Test Setup Failed
Push — 0.9 ( dd36a2 )
by Ben
05:07
created

AddAsset   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 6
c 3
b 1
f 0
dl 0
loc 9
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace Thinktomorrow\AssetLibrary\Application;
4
5
use Thinktomorrow\AssetLibrary\Asset;
6
use Thinktomorrow\AssetLibrary\HasAsset;
7
8
class AddAsset
9
{
10
    public function handle(HasAsset $model, Asset $asset, string $type, string $locale, int $order, array $data): void
11
    {
12
        $model->assetRelation()->attach($asset, [
13
            'type' => $type,
14
            'locale' => $locale,
15
            'order' => $order,
16
            'data' => $data,
17
        ]);
18
    }
19
}
20