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

AddAsset::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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