Completed
Push — master ( 7891d6...38c7f3 )
by Jonathan
01:58
created

IronEnvelope::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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 7
    /**
19
     * @var string|null
20 7
     */
21 7
    private $reservation_id;
22 7
23
    public function __construct($id, Envelope $wrapped, $reservation_id = null)
24
    {
25
        $this->id = $id;
26
        $this->wrapped = $wrapped;
27 1
        $this->reservation_id = $reservation_id;
28
    }
29 1
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function unwrap()
34
    {
35 1
        return $this->wrapped->unwrap();
36
    }
37 1
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function attempts()
42
    {
43
        return $this->wrapped->attempts();
44 1
    }
45
46 1
    /**
47
     * {@inheritdoc}
48
     * Returns a clone of the wrapped envelope, not itself.
49 3
     */
50
    public function retry()
51 3
    {
52
        return $this->wrapped->retry();
53
    }
54
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
60
    public function getReservationId()
61
    {
62
        return $this->reservation_id;
63
    }
64
}
65