Core/src/LongRunning/LongRunningOperation.php
private function executeDoneCallback($type, $response)
    {
        if (is_null($response)) {
            return null;
        }

        $callables = array_filter($this->callablesMap, function ($callable) use ($type) {
            return $callable['typeUrl'] === $type;
        });

        if (count($callables) === 0) {
            return $response;
        }

        $callable = current($callables);
        $fn = $callable['callable'];

        return call_user_func($fn, $response);
    }
private function executeDoneCallback($type, $response)
    {
        if (is_null($response)) {
            return null;
        }

        $callables = array_filter($this->callablesMap, function ($callable) use ($type) {
            return $callable['typeUrl'] === $type;
        });

        if (count($callables) === 0) {
            return $response;
        }

        $callable = current($callables);
        $fn = $callable['callable'];

        return call_user_func($fn, $response);
    }
private function executeDoneCallback ( $ type , $ response ) { if ( is_null ( $ response ) ) { return null ; } $ callables = array_filter ( $ this -> callablesMap , function ( $ callable ) use ( $ type ) { return $ callable [ 'typeUrl' ] === $ type ; } ) ; if ( count ( $ callables ) === 0 ) { return $ response ; } $ callable = current ( $ callables ) ; $ fn = $ callable [ 'callable' ] ; return call_user_func ( $ fn , $ response ) ; }
When the Operation is complete, there may be a callback enqueued to
handle the response. If so, execute it and return the result.

@param string $type The response type.
@param mixed $response The response data.
@return mixed
When the Operation is complete there may be a callback enqueued to handle the response . If so execute it and return the result .