@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * @param $msg |
| 129 | - * @param $from |
|
| 129 | + * @param ConnectionInterface $from |
|
| 130 | 130 | * @throws WebSocketException |
| 131 | 131 | */ |
| 132 | 132 | function checkForRequiredInMessage($msg,$from) |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | - * @param $clonedObject |
|
| 144 | + * @param Receiver $clonedObject |
|
| 145 | 145 | * @param $clone |
| 146 | 146 | */ |
| 147 | 147 | function cloneProperties($clonedObject, $clone) |
@@ -76,10 +76,11 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | \Session::start(); |
| 78 | 78 | |
| 79 | - if($this->routes[$msg->route]->auth && !\Auth::check()) |
|
| 80 | - $this->error($msg,$from,'Unauthenticated.'); |
|
| 81 | - else |
|
| 82 | - $this->userAuthSocketMapper[\Auth::id()] = $from->resourceId; |
|
| 79 | + if($this->routes[$msg->route]->auth && !\Auth::check()) { |
|
| 80 | + $this->error($msg,$from,'Unauthenticated.'); |
|
| 81 | + } else { |
|
| 82 | + $this->userAuthSocketMapper[\Auth::id()] = $from->resourceId; |
|
| 83 | + } |
|
| 83 | 84 | |
| 84 | 85 | $class = $this->routes[$msg->route]->controller; |
| 85 | 86 | $method = $this->routes[$msg->route]->method; |
@@ -95,8 +96,7 @@ discard block |
||
| 95 | 96 | } |
| 96 | 97 | |
| 97 | 98 | $controller->$method($msg); |
| 98 | - } |
|
| 99 | - catch (WebSocketException $exception) |
|
| 99 | + } catch (WebSocketException $exception) |
|
| 100 | 100 | { |
| 101 | 101 | |
| 102 | 102 | } |
@@ -136,8 +136,9 @@ discard block |
||
| 136 | 136 | $this->error($msg,$from,'You can\'t send a request without the route and the session id !'); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if(!isset($this->routes[$msg->route])) |
|
| 140 | - $this->error($msg,$from,'No such route !'); |
|
| 139 | + if(!isset($this->routes[$msg->route])) { |
|
| 140 | + $this->error($msg,$from,'No such route !'); |
|
| 141 | + } |
|
| 141 | 142 | } |
| 142 | 143 | |
| 143 | 144 | /** |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @param $routeName |
|
| 28 | - * @param $controller |
|
| 29 | - * @param $method |
|
| 27 | + * @param string $routeName |
|
| 28 | + * @param string $controller |
|
| 29 | + * @param string $method |
|
| 30 | 30 | * @param bool $authenticated |
| 31 | 31 | */ |
| 32 | 32 | function make($routeName, $controller, $method,$authenticated = true) |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * @param $msg |
| 23 | 23 | * @param $from |
| 24 | - * @param $error |
|
| 24 | + * @param string $error |
|
| 25 | 25 | * @throws WebSocketException |
| 26 | 26 | */ |
| 27 | 27 | function error($msg,ConnectionInterface $from, $error) |