src/Psalm/Internal/LanguageServer/Message.php
public static function parse(string $msg): Message
    {
        $obj = new self;
        $parts = explode("\r\n", $msg);
        $obj->body = MessageBody::parse(array_pop($parts));
        foreach ($parts as $line) {
            if ($line) {
                $pair = explode(': ', $line);
                $obj->headers[$pair[0]] = $pair[1];
            }
        }
        return $obj;
    }
public static function parse(string $msg): Message
    {
        $obj = new self;
        $parts = explode("\r\n", $msg);
        $obj->body = MessageBody::parse(array_pop($parts));
        foreach ($parts as $line) {
            if ($line) {
                $pair = explode(': ', $line);
                $obj->headers[$pair[0]] = $pair[1];
            }
        }
        return $obj;
    }
public static function parse ( string $ msg ) : Message { $ obj = new self ; $ parts = explode ( "\r\n" , $ msg ) ; $ obj -> body = MessageBody :: parse ( array_pop ( $ parts ) ) ; foreach ( $ parts as $ line ) { if ( $ line ) { $ pair = explode ( ': ' , $ line ) ; $ obj -> headers [ $ pair [ 0 ] ] = $ pair [ 1 ] ; } } return $ obj ; }
Parses a message

@param string $msg
@return Message
@psalm-suppress UnusedMethod
Parses a message