1 | <?php |
||
11 | abstract class AbstractBot implements ResponderAware, Matcher\MatcherAggregate |
||
12 | { |
||
13 | private $matcher; |
||
14 | |||
15 | /** |
||
16 | * @var \Crummy\Phlack\Common\Responder\ResponderInterface |
||
17 | */ |
||
18 | protected $responder; |
||
19 | |||
20 | /** |
||
21 | * @param Matcher\MatcherInterface|\Closure $matcher |
||
22 | * @param ResponderInterface $responder |
||
23 | */ |
||
24 | 11 | public function __construct($matcher = null, ResponderInterface $responder = null) |
|
34 | |||
35 | /** |
||
36 | * @param Matcher\MatcherInterface $matcher |
||
37 | * |
||
38 | * @throws \Crummy\Phlack\Common\Exception\InvalidArgumentException When given an invalid matcher. |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | 11 | public function setMatcher($matcher) |
|
55 | |||
56 | /** |
||
57 | * @return Matcher\MatcherInterface|callable |
||
58 | */ |
||
59 | 2 | public function getMatcher() |
|
63 | |||
64 | /** |
||
65 | * @param ResponderInterface $responder |
||
66 | * @return self |
||
67 | */ |
||
68 | 11 | public function setResponder(ResponderInterface $responder) |
|
73 | |||
74 | /** |
||
75 | * @param string $text |
||
76 | * |
||
77 | * @return \Crummy\Phlack\WebHook\Reply\Reply |
||
78 | */ |
||
79 | 2 | protected function say($text) |
|
83 | |||
84 | /** |
||
85 | * @param string $text |
||
86 | * |
||
87 | * @return \Crummy\Phlack\WebHook\Reply\Reply |
||
88 | */ |
||
89 | protected function emote($text) |
||
93 | |||
94 | /** |
||
95 | * @param string $user The user_id to tell |
||
96 | * @param string $text |
||
97 | * |
||
98 | * @return \Crummy\Phlack\WebHook\Reply\Reply |
||
99 | */ |
||
100 | protected function tell($user, $text) |
||
104 | |||
105 | /** |
||
106 | * @param \Crummy\Phlack\WebHook\CommandInterface $user The user_id, or a CommandInterface to inspect. |
||
107 | * @param string $text |
||
108 | * |
||
109 | * @return \Crummy\Phlack\WebHook\Reply\Reply |
||
110 | */ |
||
111 | 4 | protected function reply($user, $text) |
|
115 | |||
116 | /** |
||
117 | * @param string $text |
||
118 | * |
||
119 | * @return \Crummy\Phlack\WebHook\Reply\Reply |
||
120 | */ |
||
121 | protected function shout($text) |
||
125 | |||
126 | /** |
||
127 | * @param MessageInterface $message |
||
128 | * |
||
129 | * @return \Crummy\Phlack\WebHook\Reply\EmptyReply |
||
130 | */ |
||
131 | protected function send(MessageInterface $message) |
||
135 | } |
||
136 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.