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

IronEnvelope::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 1
cts 1
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
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 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