private function trace(string $type): \Closure
    {
        $trace = function() use ($type) {
            switch ($type) {
                case TraceableNetwork::TYPE_DATA:
                    $this->traceData(func_get_args(), $type);
                    break;
                case TraceableNetwork::TYPE_CONNECT:
                case TraceableNetwork::TYPE_DISCONNECT:
                    $this->traceAction(func_get_args(), $type);
                    break;
            }
        };

        return $trace->bindTo($this);
    }
private function trace(string $type): \Closure
    {
        $trace = function() use ($type) {
            switch ($type) {
                case TraceableNetwork::TYPE_DATA:
                    $this->traceData(func_get_args(), $type);
                    break;
                case TraceableNetwork::TYPE_CONNECT:
                case TraceableNetwork::TYPE_DISCONNECT:
                    $this->traceAction(func_get_args(), $type);
                    break;
            }
        };

        return $trace->bindTo($this);
    }
private function trace ( string $ type ) : \ Closure { $ trace = function ( ) use ( $ type ) { switch ( $ type ) { case TraceableNetwork :: TYPE_DATA : $ this -> traceData ( func_get_args ( ) , $ type ) ; break ; case TraceableNetwork :: TYPE_CONNECT : case TraceableNetwork :: TYPE_DISCONNECT : $ this -> traceAction ( func_get_args ( ) , $ type ) ; break ; } } ; return $ trace -> bindTo ( $ this ) ; }
Wrap the creation of the callback

@param string $type
@return \Closure
Wrap the creation of the callback