/** * @param $data * @return bool * true if process successful */ private function processValidFrame($data) { $json = $this->wsClient->draft10Decode($data); $parsed = json_decode($json->payload); if (json_last_error() === JSON_ERROR_NONE) { try { $this->client->onMessage($parsed); } catch (\Exception $e) { Utils::_error_log($e->getMessage() . PHP_EOL); } } else { return false; } return true; }