src/Socket.php
static function decodeMessages(string $data) {
        $msgs = array();
        
        while(($pos = \stripos($data, static::END_BUFFER)) !== false) {
            if($pos === 0) {
                $data = \substr($data, static::END_BUFFER_LEN);
                continue;
            }
            
            $msgs[] = static::decodeMessage(\substr($data, 0, $pos));
            $data = \substr($data, ($pos + static::END_BUFFER_LEN));
        }
        
        \array_unshift($msgs, $data);
        return $msgs;
    }
static function decodeMessages(string $data) {
        $msgs = array();
        
        while(($pos = \stripos($data, static::END_BUFFER)) !== false) {
            if($pos === 0) {
                $data = \substr($data, static::END_BUFFER_LEN);
                continue;
            }
            
            $msgs[] = static::decodeMessage(\substr($data, 0, $pos));
            $data = \substr($data, ($pos + static::END_BUFFER_LEN));
        }
        
        \array_unshift($msgs, $data);
        return $msgs;
    }
Decodes the input. Returns an array of Message instances.
The first element will always be the remaining unused input (`$data`).
@param string  $data
@return \CharlotteDunois\Phoebe\Message[]|string[]|null
@throws \InvalidArgumentException