1 | <?php |
||
20 | abstract class AbstractMessage implements MessageInterface |
||
21 | { |
||
22 | /** |
||
23 | * Message edit timeout |
||
24 | */ |
||
25 | protected const MESSAGE_EDIT_TIMEOUT = -1; |
||
26 | |||
27 | /** |
||
28 | * @var ChannelInterface |
||
29 | */ |
||
30 | protected $channel; |
||
31 | |||
32 | /** |
||
33 | * @var UserInterface |
||
34 | */ |
||
35 | protected $author; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $id; |
||
41 | |||
42 | /** |
||
43 | * @var NodeList |
||
44 | */ |
||
45 | protected $body; |
||
46 | |||
47 | /** |
||
48 | * @var array|UserInterface[] |
||
49 | */ |
||
50 | protected $mentions = []; |
||
51 | |||
52 | /** |
||
53 | * @var \DateTimeInterface |
||
54 | */ |
||
55 | protected $createdAt; |
||
56 | |||
57 | /** |
||
58 | * AbstractMessage constructor. |
||
59 | * @param ChannelInterface $channel |
||
60 | * @param UserInterface $author |
||
61 | * @param string $id |
||
62 | * @param NodeList $body |
||
63 | */ |
||
64 | public function __construct(ChannelInterface $channel, UserInterface $author, string $id, NodeList $body) |
||
72 | |||
73 | /** |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function canBeUpdated(): bool |
||
88 | |||
89 | /** |
||
90 | * @return \DateTimeInterface |
||
91 | */ |
||
92 | public function at(): \DateTimeInterface |
||
96 | |||
97 | /** |
||
98 | * @return array |
||
99 | */ |
||
100 | public function __debugInfo(): array |
||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getId(): string |
||
119 | |||
120 | /** |
||
121 | * @return NodeList |
||
122 | */ |
||
123 | public function getNodes(): NodeList |
||
127 | |||
128 | /** |
||
129 | * @return UserInterface |
||
130 | */ |
||
131 | public function getUser(): UserInterface |
||
135 | |||
136 | /** |
||
137 | * @return ChannelInterface |
||
138 | */ |
||
139 | public function getChannel(): ChannelInterface |
||
143 | |||
144 | /** |
||
145 | * @return \Traversable |
||
146 | */ |
||
147 | public function getMentions(): \Traversable |
||
151 | } |
||
152 |