InMailMarketing::mailMarketingMemberData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
namespace MailMarketing\Models;
4
5
use Illuminate\Foundation\Bus\PendingDispatch;
6
use MailMarketing\Jobs\UpdateMemberInMailMarketingListJob;
7
8
trait InMailMarketing
9
{
10 6
    public function mailMarketingMemberData(): array
11
    {
12 6
        return $this->only([
0 ignored issues
show
Bug introduced by
It seems like only() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
        return $this->/** @scrutinizer ignore-call */ only([
Loading history...
13 6
            'email',
14 6
            'first_name',
15 6
            'last_name',
16 6
            'phone',
17 6
        ]);
18
    }
19
20 1
    public function updateMemberInMailMarketingList($listId, bool $isAdd = true, array $tags = []): PendingDispatch
21
    {
22 1
        return UpdateMemberInMailMarketingListJob::dispatch(
23 1
            $listId,
24 1
            $this->mailMarketingMemberData(),
25 1
            $isAdd,
26 1
            $tags
27 1
        );
28
    }
29
}
30