Kraken\Channel\Model\Socket\Socket::getFrame PHP Method

getFrame() private method

private getFrame ( string $id, string $type, string $message ) : null | string
$id string
$type string
$message string
return null | string
    private function getFrame($id, $type, $message)
    {
        if ($this->type === Channel::BINDER) {
            $frame = $this->prepareBinderMessage($id, $type);
        } else {
            if ($this->type === Channel::CONNECTOR) {
                $frame = $this->prepareConnectorMessage($id, $type);
            } else {
                return null;
            }
        }
        if ($message !== null) {
            if (is_object($message)) {
                return null;
            } else {
                if (is_array($message)) {
                    $message = implode("\n", $message);
                }
            }
            $frame .= '|' . $message;
        } else {
            $frame .= '|';
        }
        return $frame;
    }