1 | <?php |
||
14 | class MessageImplementation implements Message |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $commitMessage; |
||
20 | |||
21 | /** |
||
22 | * @var Status[] |
||
23 | */ |
||
24 | private $statuses; |
||
25 | |||
26 | /** |
||
27 | * Message constructor. |
||
28 | * |
||
29 | * @param string $commitMessage |
||
30 | */ |
||
31 | public function __construct(string $commitMessage) |
||
35 | |||
36 | /** |
||
37 | * Is the title capitalised |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function isTitleCapitalised() : bool |
||
49 | |||
50 | /** |
||
51 | * Get the title length |
||
52 | * |
||
53 | * @return int |
||
54 | */ |
||
55 | public function getTitleLength() : int |
||
59 | |||
60 | /** |
||
61 | * Title ends with a full stop |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function hasTitleAFullStop() : bool |
||
75 | |||
76 | /** |
||
77 | * Has a gap after the title |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function hasBlankLineAfterTitle() : bool |
||
89 | |||
90 | /** |
||
91 | * Has this message got a body |
||
92 | * |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function hasABody(): bool |
||
105 | |||
106 | /** |
||
107 | * The length at which the message wraps |
||
108 | * |
||
109 | * @return int |
||
110 | */ |
||
111 | public function getBodyWrapLength() : int |
||
128 | |||
129 | /** |
||
130 | * Associate a status with this message |
||
131 | * |
||
132 | * @param Status $status |
||
133 | */ |
||
134 | public function addStatus(Status $status) |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Get the status associated with this message |
||
142 | * |
||
143 | * @return Status[] |
||
144 | */ |
||
145 | protected function getStatuses() |
||
149 | |||
150 | /** |
||
151 | * Get the number of statuses |
||
152 | * |
||
153 | * @return int |
||
154 | */ |
||
155 | public function getStatusCount() : int |
||
159 | } |
||
160 |