public static function emitComplete(
        TransactionInterface $transaction,
        array $stats = []
    ) {
        $request = $transaction->getRequest();
        $transaction->getResponse()->setEffectiveUrl($request->getUrl());
        try {
            $request->getEmitter()->emit(
                'complete',
                new CompleteEvent($transaction, $stats)
            );
        } catch (RequestException $e) {
            self::emitError($transaction, $e, $stats);
        }
    }
public static function emitComplete(
        TransactionInterface $transaction,
        array $stats = []
    ) {
        $request = $transaction->getRequest();
        $transaction->getResponse()->setEffectiveUrl($request->getUrl());
        try {
            $request->getEmitter()->emit(
                'complete',
                new CompleteEvent($transaction, $stats)
            );
        } catch (RequestException $e) {
            self::emitError($transaction, $e, $stats);
        }
    }
public static function emitComplete ( TransactionInterface $ transaction , array $ stats = [ ] ) { $ request = $ transaction -> getRequest ( ) ; $ transaction -> getResponse ( ) -> setEffectiveUrl ( $ request -> getUrl ( ) ) ; try { $ request -> getEmitter ( ) -> emit ( 'complete' , new CompleteEvent ( $ transaction , $ stats ) ) ; } catch ( RequestException $ e ) { self :: emitError ( $ transaction , $ e , $ stats ) ; } }
Emits the complete event for a request and emits an error
event if an error is encountered during the after send.

@param TransactionInterface $transaction Transaction to emit for
@param array                $stats       Transfer stats

@throws RequestException
Emits the complete event for a request and emits an error event if an error is encountered during the after send .