VodafoneMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 10
c 3
b 0
f 0
dl 0
loc 62
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A from() 0 5 1
A unicode() 0 5 1
A __construct() 0 3 1
A content() 0 5 1
1
<?php
2
3
namespace NotificationChannels\Vodafone;
4
5
class VodafoneMessage
6
{
7
    /**
8
     * @var string
9
     */
10
    public $content;
11
12
    /**
13
     * @var array
14
     */
15
    public $from;
16
17
    /**
18
     * Create a new message instance.
19
     *
20
     * @param string $content
21
     *
22
     * @return void
23
     */
24
    public function __construct($content = '')
25
    {
26
        $this->content = $content;
27
    }
28
29
    /**
30
     * Set the notification content.
31
     *
32
     * @param string $value
33
     *
34
     * @return $this
35
     */
36
    public function content($value)
37
    {
38
        $this->content = $value;
39
40
        return $this;
41
    }
42
43
    /**
44
     * Set the notification sender.
45
     *
46
     * @param string $value
47
     *
48
     * @return $this
49
     */
50
    public function from($value)
51
    {
52
        $this->from = $value;
0 ignored issues
show
Documentation Bug introduced by
It seems like $value of type string is incompatible with the declared type array of property $from.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
53
54
        return $this;
55
    }
56
57
    /**
58
     * Set the message type.
59
     *
60
     * @return $this
61
     */
62
    public function unicode()
63
    {
64
        $this->type = 'unicode';
0 ignored issues
show
Bug Best Practice introduced by
The property type does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
65
66
        return $this;
67
    }
68
}
69