private function intercept(array &$interceptors, &$request, &$method, &$metadata, &$options, callable $callback)
    {
        /** @var Client\Interceptors\Base $i */
        $i = array_shift($interceptors);
        if ($i) {
            $i->setRequest($request);
            $i->setMethod($method);
            $i->setMetadata($metadata);
            $client = $this->getClient();
            $i->setStub($client);
            return $i->call(function () use (
                &$i,
                &$interceptors,
                &$method,
                &$request,
                &$metadata,
                &$options,
                &$callback
            ) {
                $metadata = $i->getMetadata();
                $request = $i->getRequest();
                if (count($interceptors) > 0) {
                    return $this->intercept($interceptors, $request, $method, $metadata, $options, $callback);
                } else {
                    return $callback();
                }
            });
        } else {
            return $callback();
        }
    }
private function intercept(array &$interceptors, &$request, &$method, &$metadata, &$options, callable $callback)
    {
        /** @var Client\Interceptors\Base $i */
        $i = array_shift($interceptors);
        if ($i) {
            $i->setRequest($request);
            $i->setMethod($method);
            $i->setMetadata($metadata);
            $client = $this->getClient();
            $i->setStub($client);
            return $i->call(function () use (
                &$i,
                &$interceptors,
                &$method,
                &$request,
                &$metadata,
                &$options,
                &$callback
            ) {
                $metadata = $i->getMetadata();
                $request = $i->getRequest();
                if (count($interceptors) > 0) {
                    return $this->intercept($interceptors, $request, $method, $metadata, $options, $callback);
                } else {
                    return $callback();
                }
            });
        } else {
            return $callback();
        }
    }
private function intercept ( array & $ interceptors , & $ request , & $ method , & $ metadata , & $ options , callable $ callback ) { /** @var Client\Interceptors\Base $i */ $ i = array_shift ( $ interceptors ) ; if ( $ i ) { $ i -> setRequest ( $ request ) ; $ i -> setMethod ( $ method ) ; $ i -> setMetadata ( $ metadata ) ; $ client = $ this -> getClient ( ) ; $ i -> setStub ( $ client ) ; return $ i -> call ( function ( ) use ( & $ i , & $ interceptors , & $ method , & $ request , & $ metadata , & $ options , & $ callback ) { $ metadata = $ i -> getMetadata ( ) ; $ request = $ i -> getRequest ( ) ; if ( count ( $ interceptors ) > 0 ) { return $ this -> intercept ( $ interceptors , $ request , $ method , $ metadata , $ options , $ callback ) ; } else { return $ callback ( ) ; } } ) ; } else { return $ callback ( ) ; } }
Intercept the call with the registered interceptors for the client

@param array $interceptors
@param \Google\Protobuf\Internal\Message $request
@param string $method
@param array $metadata
@param array $options
@param callable $callback
@return mixed
Intercept the call with the registered interceptors for the client