Every8dMessage::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
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
     * The message send time.
23
     *
24
     * @var \Carbon\Carbon|string
25
     */
26
    public $sendTime;
27
28
    /**
29
     * Create a new message instance.
30
     *
31
     * @param string $content
32
     */
33 5
    public function __construct($content = '')
34
    {
35 5
        $this->content = $content;
36 5
    }
37
38
    /**
39
     * Set the message subject.
40
     *
41
     * @param string $subject
42
     * @return $this
43
     */
44 1
    public function subject($subject)
45
    {
46 1
        $this->subject = $subject;
47
48 1
        return $this;
49
    }
50
51
    /**
52
     * Set the message subject.
53
     *
54
     * @param string $content
55
     * @return $this
56
     */
57 1
    public function content($content)
58
    {
59 1
        $this->content = $content;
60
61 1
        return $this;
62
    }
63
64
    /**
65
     * Set the message send time.
66
     *
67
     * @param \Carbon\Carbon|string $sendTime
68
     * @return $this
69
     */
70 1
    public function sendTime($sendTime)
71
    {
72 1
        $this->sendTime = $sendTime;
73
74 1
        return $this;
75
    }
76
77
    /**
78
     * Create a new message instance.
79
     *
80
     * @param string $content
81
     * @return static
82
     */
83 1
    public static function create($content)
84
    {
85 1
        return new static($content);
86
    }
87
}
88