Net/Notifier/WebSocket/Frame.php
public function parse($data)
    {
        if ($this->state === self::STATE_UNSENT) {
            $this->state = self::STATE_OPENED;
        }

        if ($this->isHeaderComplete) {
            $data = $this->parseData($data);
        } else {
            $data = $this->parseHeader($data);
        }

        if ($this->cursor == $this->getLength() + $this->headerLength) {
            $this->state = self::STATE_DONE;
        }

        return $data;
    }
public function parse($data)
    {
        if ($this->state === self::STATE_UNSENT) {
            $this->state = self::STATE_OPENED;
        }

        if ($this->isHeaderComplete) {
            $data = $this->parseData($data);
        } else {
            $data = $this->parseHeader($data);
        }

        if ($this->cursor == $this->getLength() + $this->headerLength) {
            $this->state = self::STATE_DONE;
        }

        return $data;
    }
public function parse ( $ data ) { if ( $ this -> state === self :: STATE_UNSENT ) { $ this -> state = self :: STATE_OPENED ; } if ( $ this -> isHeaderComplete ) { $ data = $ this -> parseData ( $ data ) ; } else { $ data = $ this -> parseHeader ( $ data ) ; } if ( $ this -> cursor == $ this -> getLength ( ) + $ this -> headerLength ) { $ this -> state = self :: STATE_DONE ; } return $ data ; }
Parses raw data for this frame

This is intented to be called after reading a raw data chunk from a
WebSocket endpoint. If the chunk contains more data than this frame, the
extra data is returned so it may be passed to the next frame for
parsing.

@param string $data the raw data to parse.

@return string any remaining unparsed data not belonging to this frame.
Parses raw data for this frame