Test Failed
Push — main ( 6459c5...614062 )
by
unknown
08:35 queued 05:45
created

InMailMarketing::mailMarketingMemberData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 6
cp 0
crap 2
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
    public function mailMarketingMemberData(): array
11
    {
12
        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
            'email',
14
            'first_name',
15
            'last_name',
16
            'phone',
17
        ]);
18
    }
19
20
    public function updateMemberInMailMarketingList($listId, bool $isAdd = true, array $tags = []): PendingDispatch
21
    {
22
        return UpdateMemberInMailMarketingListJob::dispatch(
23
            $listId,
24
            $this->mailMarketingMemberData(),
25
            $isAdd,
26
            $tags
27
        );
28
    }
29
}
30