Total Complexity | 8 |
Total Lines | 92 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | class PendingReply |
||
16 | { |
||
17 | private $channel; |
||
18 | private $chat; |
||
19 | private $user; |
||
20 | private $text; |
||
21 | private $template; |
||
22 | private $attachment; |
||
23 | private $delay; |
||
24 | |||
25 | 5 | public function __construct(Channel $channel, Chat $chat, User $user) |
|
30 | 5 | } |
|
31 | |||
32 | /** |
||
33 | * Set reply text. |
||
34 | * |
||
35 | * @param null|string $text |
||
36 | * |
||
37 | * @return static |
||
38 | */ |
||
39 | 3 | public function text(?string $text) |
|
40 | { |
||
41 | 3 | $this->text = $text; |
|
42 | |||
43 | 3 | return $this; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * Set template for reply. |
||
48 | * |
||
49 | * @param Template|null $template |
||
50 | * |
||
51 | * @return static |
||
52 | */ |
||
53 | 2 | public function template(?Template $template) |
|
54 | { |
||
55 | 2 | $this->template = $template; |
|
56 | |||
57 | 2 | return $this; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * Set attachment for send. |
||
62 | * |
||
63 | * @param Attachment $attachment |
||
64 | * |
||
65 | * @return static |
||
66 | */ |
||
67 | 2 | public function attachment(Attachment $attachment) |
|
72 | } |
||
73 | |||
74 | /** |
||
75 | * Set the desired delay for the job. |
||
76 | * |
||
77 | * @param \DateTime|int|null $delay |
||
78 | * |
||
79 | * @return static |
||
80 | */ |
||
81 | 2 | public function delay($delay) |
|
86 | } |
||
87 | |||
88 | 5 | public function __destruct() |
|
110 |