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

Every8dMessage::content()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 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