Completed
Push — master ( c94975...41fe5e )
by recca
02:53 queued 13s
created

Every8dMessage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 2
cbo 0
dl 0
loc 65
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A subject() 0 6 1
A content() 0 6 1
A create() 0 4 1
1
<?php
2
3
namespace Recca0120\Every8d;
4
5
class Every8dMessage
6
{
7
    /**
8
     * The message subject.
9
     *
10
     * @var string
11
     */
12
    public $subject = null;
13
14
    /**
15
     * The message content.
16
     *
17
     * @var string
18
     */
19
    public $content;
20
21
    /**
22
     * Create a new message instance.
23
     *
24
     * @param string $content
25
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
26
     */
27 6
    public function __construct($content = '')
28
    {
29 6
        $this->content = $content;
30 6
    }
31
32
    /**
33
     * Set the message subject.
34
     *
35
     * @param string $subject
36
     * @return $this
37
     */
38 2
    public function subject($subject)
39
    {
40 2
        $this->subject = $subject;
41
42 2
        return $this;
43
    }
44
45
    /**
46
     * Set the message subject.
47
     *
48
     * @param string $content
49
     * @return $this
50
     */
51 1
    public function content($content)
52
    {
53 1
        $this->content = $content;
54
55 1
        return $this;
56
    }
57
58
    /**
59
     * Create a new message instance.
60
     *
61
     * @param string $content
62
     *
63
     * @return static
64
     */
65 2
    public static function create($content)
66
    {
67 2
        return new static($content);
68
    }
69
}
70