public function middleware($middleware = null)
    {
        if (is_null($middleware)) {
            return $this->middleware;
        }

        if (is_string($middleware)) {
            $middleware = func_get_args();
        }

        $this->middleware = array_unique(array_merge($this->middleware, $middleware));

        return $this;
    }
public function middleware($middleware = null)
    {
        if (is_null($middleware)) {
            return $this->middleware;
        }

        if (is_string($middleware)) {
            $middleware = func_get_args();
        }

        $this->middleware = array_unique(array_merge($this->middleware, $middleware));

        return $this;
    }
public function middleware ( $ middleware = null ) { if ( is_null ( $ middleware ) ) { return $ this -> middleware ; } if ( is_string ( $ middleware ) ) { $ middleware = func_get_args ( ) ; } $ this -> middleware = array_unique ( array_merge ( $ this -> middleware , $ middleware ) ) ; return $ this ; }
Get or set middleware.

@param array|string|null $middleware

@return array|\SwooleTW\Http\Websocket\Websocket
Get or set middleware .