public function onBefore(AbstractRequestEvent $event) { $this->addConfigSettings($event->getRequest()->getConfig()); if (!$this->state->isOk($this->name)) { $this->handleErroneousState($event); } }
/** * @param TransactionInterface $transaction Transaction that contains the * request and response. * @throws \RuntimeException */ public function __construct(TransactionInterface $transaction) { parent::__construct($transaction); if (!$transaction->getResponse()) { throw new \RuntimeException('A response must be present'); } }
/** * @param Transaction $transaction Transaction being sent. * @param int $downloadSize Amount of data to download (if known) * @param int $downloaded Amount of data that has been downloaded * @param int $uploadSize Amount of data to upload (if known) * @param int $uploaded Amount of data that had been uploaded */ public function __construct(Transaction $transaction, $downloadSize, $downloaded, $uploadSize, $uploaded) { parent::__construct($transaction); $this->downloadSize = $downloadSize; $this->downloaded = $downloaded; $this->uploadSize = $uploadSize; $this->uploaded = $uploaded; }
/** * @param TransactionInterface $transaction Transaction * @param array $transferInfo Transfer statistics */ public function __construct(TransactionInterface $transaction, $transferInfo = []) { parent::__construct($transaction); $this->transferInfo = $transferInfo; }