/** * This method declares a new exchange * * @param Options $options * * @return $this - Channel - Provides fluent interface */ public function declareExchange(Options $options) { $this->exchangeOptions = $options; $this->exchange_declare($this->exchangeOptions->getName(), $this->exchangeOptions->getType(), $this->exchangeOptions->getPassive(), $this->exchangeOptions->getDurable(), $this->exchangeOptions->getAutoDelete(), $this->exchangeOptions->getInternal(), $this->exchangeOptions->getNowait(), $this->exchangeOptions->getArguments(), $this->exchangeOptions->getTicket()); return $this; }
/** * * @param Options $options * * @throws InvalidArgumentException * * @return $this Connection - Provides fluent interface */ public function setExchangeOptions(Options $options) { $name = $options->getName(); $type = $options->getType(); if (empty($name)) { throw new InvalidArgumentException('You must provide an exchange name'); } if (empty($type)) { throw new InvalidArgumentException('You must provide an exchange type'); } $this->exchangeOptions = $options; return $this; }