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 (#15)
by
unknown
06:02
created

SmscRuMessage   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 112
Duplicated Lines 0 %

Coupling/Cohesion

Components 4
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
c 0
b 0
f 0
lcom 4
cbo 0
dl 0
loc 112
ccs 0
cts 18
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A __construct() 0 4 1
A content() 0 6 1
A from() 0 6 1
A timestamp() 0 8 2
A timezone() 0 8 2
1
<?php
2
3
namespace NotificationChannels\SmscRu;
4
5
class SmscRuMessage
6
{
7
    /**
8
     * The phone number the message should be sent from.
9
     *
10
     * @var string
11
     */
12
    public $from = '';
13
14
    /**
15
     * The message content.
16
     *
17
     * @var string
18
     */
19
    public $content = '';
20
21
    /**
22
     * Time of sending a message.
23
     *
24
     * @var integer
25
     */
26
    public $time;
27
28
    /**
29
     * Timezone of sending a message.
30
     *
31
     * @var integer
32
     */
33
    public $tz;
34
35
    /**
36
     * Create a new message instance.
37
     *
38
     * @param  string $content
39
     *
40
     * @return static
41
     */
42
    public static function create($content = '')
43
    {
44
        return new static($content);
45
    }
46
47
    /**
48
     * @param  string  $content
49
     */
50
    public function __construct($content = '')
51
    {
52
        $this->content = $content;
53
    }
54
55
    /**
56
     * Set the message content.
57
     *
58
     * @param  string  $content
59
     *
60
     * @return $this
61
     */
62
    public function content($content)
63
    {
64
        $this->content = $content;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Set the phone number or sender name the message should be sent from.
71
     *
72
     * @param  string  $from
73
     *
74
     * @return $this
75
     */
76
    public function from($from)
77
    {
78
        $this->from = $from;
79
80
        return $this;
81
    }
82
83
    /**
84
     * Set the time the message should be sent.
85
     * Accept unix timestamp, ex. 1495459379
86
     *
87
     * @param  integer  $time
88
     *
89
     * @return $this
90
     */
91
    public function timestamp($time)
92
    {
93
        if (is_int($time)) {
94
            $this->time = $time;
95
        }
96
97
        return $this;
98
    }
99
100
    /**
101
     * Set the timezone relatively to Europe/Moscow.
102
     * The value can be negative.
103
     *
104
     * @param  integer  $tz
105
     *
106
     * @return $this
107
     */
108
    public function timezone($tz)
109
    {
110
        if (is_int($tz)) {
111
            $this->tz = $tz;
112
        }
113
114
        return $this;
115
    }
116
}
117