1 | <?php |
||
19 | class MessageImplementation implements Message |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $commitMessage; |
||
25 | |||
26 | /** |
||
27 | * @var Status[] |
||
28 | */ |
||
29 | private $statuses = []; |
||
30 | |||
31 | /** |
||
32 | * Message constructor. |
||
33 | * |
||
34 | * @param string $commitMessage |
||
35 | */ |
||
36 | public function __construct(string $commitMessage) |
||
40 | |||
41 | /** |
||
42 | * Is the title capitalised. |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function isTitleCapitalised(): bool |
||
55 | |||
56 | /** |
||
57 | * Get the title length. |
||
58 | * |
||
59 | * @return int |
||
60 | */ |
||
61 | public function getTitleLength(): int |
||
65 | |||
66 | /** |
||
67 | * Title ends with a full stop. |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function hasTitleAFullStop(): bool |
||
81 | |||
82 | /** |
||
83 | * Has a gap after the title. |
||
84 | * |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function hasBlankLineAfterTitle(): bool |
||
95 | |||
96 | /** |
||
97 | * Has this message got a body. |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function hasABody(): bool |
||
111 | |||
112 | /** |
||
113 | * The length at which the message wraps. |
||
114 | * |
||
115 | * @return int |
||
116 | */ |
||
117 | public function getBodyWrapLength(): int |
||
134 | |||
135 | /** |
||
136 | * Associate a status with this message. |
||
137 | * |
||
138 | * @param Status $status |
||
139 | */ |
||
140 | public function addStatus(Status $status) |
||
144 | |||
145 | /** |
||
146 | * Get the status associated with this message. |
||
147 | * |
||
148 | * @return Status[] |
||
149 | */ |
||
150 | public function getStatuses(): array |
||
154 | } |
||
155 |