GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#234)
by David
02:05
created

Envelope   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 5
Bugs 1 Features 0
Metric Value
wmc 7
c 5
b 1
f 0
lcom 1
cbo 1
dl 0
loc 65
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getMessage() 0 4 1
A getName() 0 4 1
A getReceipt() 0 4 1
A getClass() 0 4 1
A getTimestamp() 0 4 1
A setReceipt() 0 4 1
1
<?php
2
3
namespace Bernard;
4
5
/**
6
 * Wraps a Message with metadata that can be used for automatic retry
7
 * or inspection.
8
 *
9
 * @package Bernard
10
 */
11
class Envelope
12
{
13
    protected $message;
14
    protected $class;
15
    protected $timestamp;
16
    protected $receipt;
17
18
    /**
19
     * @param Message $message
20
     */
21
    public function __construct(Message $message)
22
    {
23
        $this->message = $message;
24
        $this->class = get_class($message);
25
        $this->timestamp = time();
26
    }
27
28
    /**
29
     * @return Message
30
     */
31
    public function getMessage()
32
    {
33
        return $this->message;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getName()
40
    {
41
        return $this->message->getName();
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getReceipt()
48
    {
49
        return $this->receipt;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getClass()
56
    {
57
        return $this->class;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getTimestamp()
64
    {
65
        return $this->timestamp;
66
    }
67
68
    /**
69
     * @param mixed $receipt
70
     */
71
    public function setReceipt($receipt)
72
    {
73
        $this->receipt = $receipt;
74
    }
75
}
76