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);
        }
    }