defaultAdapter = $defaultAdapter; $this->streamingAdapter = $streamingAdapter; } public function send(TransactionInterface $transaction) { return $transaction->getRequest()->getConfig()['stream'] ? $this->streamingAdapter->send($transaction) : $this->defaultAdapter->send($transaction); } }