1 | <?php |
||
14 | class MessageImplementation implements Message |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $commitMessage; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $sha; |
||
25 | |||
26 | /** |
||
27 | * @var Status |
||
28 | */ |
||
29 | private $status; |
||
30 | |||
31 | /** |
||
32 | * Message constructor. |
||
33 | * |
||
34 | * @param string $sha |
||
35 | * @param string $commitMessage |
||
36 | */ |
||
37 | public function __construct(string $sha, string $commitMessage) |
||
42 | |||
43 | /** |
||
44 | * Is the title capitalised |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function isTitleCapitalised() : bool |
||
56 | |||
57 | /** |
||
58 | * Get the title length |
||
59 | * |
||
60 | * @return int |
||
61 | */ |
||
62 | public function getTitleLength() : int |
||
66 | |||
67 | /** |
||
68 | * Title ends with a full stop |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function hasTitleAFullStop() : bool |
||
82 | |||
83 | /** |
||
84 | * Has a gap after the title |
||
85 | * |
||
86 | * @return bool |
||
87 | */ |
||
88 | public function hasBlankLineAfterTitle() : bool |
||
96 | |||
97 | /** |
||
98 | * Has this message got a body |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function hasABody(): bool |
||
112 | |||
113 | /** |
||
114 | * The length at which the message wraps |
||
115 | * |
||
116 | * @return int |
||
117 | */ |
||
118 | public function getBodyWrapLength() : int |
||
135 | |||
136 | /** |
||
137 | * Get the SHA that identifies this commit |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getSha() : string |
||
145 | |||
146 | /** |
||
147 | * Get the status associated with this message |
||
148 | * |
||
149 | * @throws |
||
150 | * |
||
151 | * @return Status |
||
152 | */ |
||
153 | public function getStatus() |
||
157 | |||
158 | /** |
||
159 | * Associate a status with this message |
||
160 | * |
||
161 | * @param Status $status |
||
162 | */ |
||
163 | public function setStatus(Status $status) |
||
167 | } |
||
168 |