File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public function sendText($channel, $message)
133133 */
134134 public function hangup ($ channel , $ cause )
135135 {
136- return $ this ->request ('Hangup ' , array ('Channel ' => $ channel , 'Cause ' => $ cause ));
136+ return $ this ->request ('Hangup ' , array ('Channel ' => $ channel , 'Cause ' => ( string ) $ cause ));
137137 }
138138
139139 /**
@@ -201,7 +201,7 @@ private function boolParam($value)
201201
202202 /**
203203 * @param string $name
204- * @param array $args
204+ * @param array<string,string|string[]|null> $args
205205 * @return \React\Promise\PromiseInterface<Response,\Exception>
206206 */
207207 private function request ($ name , array $ args = array ())
Original file line number Diff line number Diff line change 77use Clue \React \Ami \Protocol \Event ;
88use Clue \React \Ami \Protocol \Message ;
99use Clue \React \Ami \Protocol \Parser ;
10+ use Clue \React \Ami \Protocol \Response ;
1011use Clue \React \Ami \Protocol \UnexpectedMessageException ;
1112use Evenement \EventEmitter ;
1213use React \Promise \Deferred ;
@@ -102,6 +103,8 @@ public function handleMessage(Message $message)
102103 $ this ->emit ('event ' , array ($ message ));
103104 return ;
104105 }
106+
107+ assert ($ message instanceof Response);
105108 $ id = $ message ->getActionId ();
106109 if (!isset ($ this ->pending [$ id ])) {
107110 $ this ->emit ('error ' , array (new UnexpectedMessageException ($ message ), $ this ));
@@ -187,7 +190,7 @@ public function isBusy()
187190 * ```
188191 *
189192 * @param string $name
190- * @param array $args
193+ * @param array<string,string|string[]|null> $args
191194 * @return Action
192195 */
193196 public function createAction ($ name , array $ args = array ())
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class Parser
1616 private $ buffer = '' ;
1717 private $ gotInitial = false ;
1818
19+ /**
20+ * @param string $chunk
21+ * @return array<Event|Response>
22+ */
1923 public function push ($ chunk )
2024 {
2125 $ this ->buffer .= $ chunk ;
You can’t perform that action at this time.
0 commit comments