Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function handle(SpikeInterface $message) |
||
30 | { |
||
31 | $clientId = $message->getHeader('client-id'); |
||
32 | $client = $this->server->getClientById($clientId); |
||
33 | if (!$client){ |
||
34 | $event = new Event(Events::UNAUTHORIZED_CLIENT, $this, [ |
||
35 | 'clientId' => $clientId, |
||
36 | 'connection' => $this->connection, |
||
37 | ]); |
||
38 | $this->getEventDispatcher()->dispatch($event); |
||
39 | $this->connection->close(); |
||
40 | } else { |
||
41 | $this->client = $client; |
||
42 | $this->client->setActiveAt(new \DateTime()); //Update last active time. |
||
43 | } |
||
44 | } |
||
45 | |||
53 | } |