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

IronEnvelope   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 59
ccs 12
cts 12
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A unwrap() 0 4 1
A attempts() 0 4 1
A retry() 0 4 1
A getId() 0 4 1
A getReservationId() 0 4 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