File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -43,16 +43,10 @@ protected function init(): void {
4343 }
4444
4545 /**
46- * send a message to the client
47- *
48- * @param string $type
49- * @param mixed $data
50- *
5146 * @throws \BadMethodCallException
52- * if only one parameter is given, a typeless message will be send with that parameter as data
5347 * @suppress PhanDeprecatedFunction
5448 */
55- public function send ($ type , $ data = null ) {
49+ public function send (string $ type , mixed $ data = null ): void {
5650 if ($ data && !preg_match ('/^[A-Za-z0-9_]+$/ ' , $ type )) {
5751 throw new \BadMethodCallException ('Type needs to be alphanumeric ( ' . $ type . ') ' );
5852 }
@@ -69,10 +63,7 @@ public function send($type, $data = null) {
6963 flush ();
7064 }
7165
72- /**
73- * close the connection of the event source
74- */
75- public function close () {
66+ public function close (): void {
7667 $ this ->send ('__internal__ ' , 'close ' ); //server side closing can be an issue, let the client do it
7768 }
7869}
You can’t perform that action at this time.
0 commit comments