1 | <?php |
||
18 | abstract class AbstractMessage implements MessageInterface |
||
19 | { |
||
20 | /** |
||
21 | * Message edit timeout |
||
22 | */ |
||
23 | protected const MESSAGE_EDIT_TIMEOUT = -1; |
||
24 | |||
25 | /** |
||
26 | * @var ChannelInterface |
||
27 | */ |
||
28 | protected $channel; |
||
29 | |||
30 | /** |
||
31 | * @var UserInterface |
||
32 | */ |
||
33 | protected $author; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $id; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $body; |
||
44 | |||
45 | /** |
||
46 | * @var array|UserInterface[] |
||
47 | */ |
||
48 | protected $mentions = []; |
||
49 | |||
50 | /** |
||
51 | * @var \DateTimeInterface |
||
52 | */ |
||
53 | protected $createdAt; |
||
54 | |||
55 | /** |
||
56 | * AbstractMessage constructor. |
||
57 | * @param ChannelInterface $channel |
||
58 | * @param UserInterface $author |
||
59 | * @param string $id |
||
60 | * @param string $body |
||
61 | */ |
||
62 | public function __construct(ChannelInterface $channel, UserInterface $author, string $id, string $body) |
||
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getBody(): string |
||
78 | |||
79 | /** |
||
80 | * @return ChannelInterface |
||
81 | */ |
||
82 | public function getChannel(): ChannelInterface |
||
86 | |||
87 | /** |
||
88 | * @return UserInterface |
||
89 | */ |
||
90 | public function getUser(): UserInterface |
||
94 | |||
95 | /** |
||
96 | * @return \Traversable |
||
97 | */ |
||
98 | public function getMentions(): \Traversable |
||
102 | |||
103 | /** |
||
104 | * @return \DateTimeInterface |
||
105 | */ |
||
106 | public function at(): \DateTimeInterface |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getId(): string |
||
118 | |||
119 | /** |
||
120 | * @return bool |
||
121 | */ |
||
122 | public function canBeUpdated(): bool |
||
132 | } |
||
133 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.