/**
  * Closing message test
  */
 public function testClose()
 {
     $this->assertInternalType('string', Messenger::close('test'));
 }
Beispiel #2
0
 /**
  * Close conversation event
  *
  * @param ConnectionInterface $conn
  */
 public function onClose(ConnectionInterface $conn)
 {
     // The connection is closed, remove it, as we can no longer send it messages
     $this->clients->detach($conn);
     // pulled data from queues
     $data = $this->queueService->pull(['hash' => md5($this->getIpAddress($conn) . $this->getUserAgent($conn))], function ($response) use($conn) {
         return array_merge($response, ['ua' => $this->getUserAgent($conn), 'language' => $this->getLanguage($conn), 'location' => $this->getLocation($conn), 'close' => time()]);
     });
     // save data to storage
     $this->storageService->add($data);
     echo Messenger::close($this->getIpAddress($conn));
     // end profiler
     if (defined('SONAR_VERBOSE') === true) {
         Profiler::finish();
         Profiler::getProfilingData();
     }
 }