IronEnvelope::retry()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Spekkionu\PMG\Queue\Iron\Envelope;
3
4
use PMG\Queue\Envelope;
5
6
class IronEnvelope implements Envelope
7
{
8
   /**
9
     * @var int Job ID
10
     */
11
    private $id;
12
13
    /**
14
     * @var Envelope
15
     */
16
    private $wrapped;
17
18
    /**
19
     * @var string|null
20
     */
21
    private $reservation_id;
22
23 7
    public function __construct($id, Envelope $wrapped, $reservation_id = null)
24
    {
25 7
        $this->id = $id;
26 7
        $this->wrapped = $wrapped;
27 7
        $this->reservation_id = $reservation_id;
28 7
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function unwrap()
34
    {
35 1
        return $this->wrapped->unwrap();
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 1
    public function attempts()
42
    {
43 1
        return $this->wrapped->attempts();
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     * Returns a clone of the wrapped envelope, not itself.
49
     */
50 1
    public function retry()
51
    {
52 1
        return $this->wrapped->retry();
53
    }
54
55 3
    public function getId()
56
    {
57 3
        return $this->id;
58
    }
59
60 1
    public function getReservationId()
61
    {
62 1
        return $this->reservation_id;
63
    }
64
}
65