SqsFifoQueueable::withDeduplicator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace ShiftOneLabs\LaravelSqsFifoQueue\Bus;
4
5
trait SqsFifoQueueable
6
{
7
    /**
8
     * The message group id the job should be sent to.
9
     *
10
     * @var string
11
     */
12
    public $messageGroupId;
13
14
    /**
15
     * The deduplication method to use for the job.
16
     *
17
     * @var string
18
     */
19
    public $deduplicator;
20
21
    /**
22
     * Set the desired message group id for the job.
23
     *
24
     * @param  string  $messageGroupId
25
     *
26
     * @return $this
27
     */
28 36
    public function onMessageGroup($messageGroupId)
29
    {
30 36
        $this->messageGroupId = $messageGroupId;
31
32 36
        return $this;
33
    }
34
35
    /**
36
     * Set the desired deduplication method for the job.
37
     *
38
     * @param  string  $deduplicator
39
     *
40
     * @return $this
41
     */
42 54
    public function withDeduplicator($deduplicator)
43
    {
44 54
        $this->deduplicator = $deduplicator;
45
46 54
        return $this;
47
    }
48
49
    /**
50
     * Remove the deduplication method from the job.
51
     *
52
     * @return $this
53
     */
54 18
    public function withoutDeduplicator()
55
    {
56 18
        return $this->withDeduplicator('');
57
    }
58
}
59