public static function getSocketType(string $packet)
    {
        $type = $packet[0] ?? null;

        if (! array_key_exists($type, static::$socketTypes)) {
            return null;
        }

        return (int) $type;
    }
public static function getSocketType(string $packet)
    {
        $type = $packet[0] ?? null;

        if (! array_key_exists($type, static::$socketTypes)) {
            return null;
        }

        return (int) $type;
    }
public static function getSocketType ( string $ packet ) { $ type = $ packet [ 0 ] ?? null ; if ( ! array_key_exists ( $ type , static :: $ socketTypes ) ) { return null ; } return ( int ) $ type ; }
Get socket packet type of a raw payload.

@param string $packet

@return int|null
Get socket packet type of a raw payload .