code: public function create(\AMQPChannel $channel, $declare = false)
      {
          $exchange = new \AMQPExchange($channel);
  
          $exchange->setName($this->name);
          $exchange->setType($this->type);
          $exchange->setFlags($this->flags);
  
          // In some setups a empty array for setArguments will cause a segfault
          // so let's avoid that
          if (!empty($this->arguments)) {
              $exchange->setArguments($this->arguments);
          }
  
          // Only declare a exchange if we are forced or the queue is not durable
          if ($declare || !$this->isDurable()) {
              $exchange->declareExchange();
          }
  
          return $exchange;
      }
docs: Create a @see \AMQPExchange instance using a given @see \AMQPChannel.
  
  @param \AMQPChannel $channel
  @param bool|false $declare If True then force the queue setup
  @return \AMQPExchange