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

InMailMarketing   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 19
ccs 0
cts 13
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A updateMemberInMailMarketingList() 0 7 1
A mailMarketingMemberData() 0 7 1
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