src/Transport/RabbitMq/BrokerModel.php
private function produceExchangeInstance($exchangeName)
    {
        if (isset($this->declaredExchangeInstances[$exchangeName])) {
            return $this->declaredExchangeInstances[$exchangeName];
        }

        if (isset($this->usedExchangeInstances[$exchangeName])) {
            return $this->usedExchangeInstances[$exchangeName];
        }

        $this->ensureChannel();
        $exchange = new AMQPExchange($this->channel);
        $exchange->setName($exchangeName);
        $this->usedExchangeInstances[$exchangeName] = $exchange;
        return $exchange;
    }
private function produceExchangeInstance($exchangeName)
    {
        if (isset($this->declaredExchangeInstances[$exchangeName])) {
            return $this->declaredExchangeInstances[$exchangeName];
        }

        if (isset($this->usedExchangeInstances[$exchangeName])) {
            return $this->usedExchangeInstances[$exchangeName];
        }

        $this->ensureChannel();
        $exchange = new AMQPExchange($this->channel);
        $exchange->setName($exchangeName);
        $this->usedExchangeInstances[$exchangeName] = $exchange;
        return $exchange;
    }
private function produceExchangeInstance ( $ exchangeName ) { if ( isset ( $ this -> declaredExchangeInstances [ $ exchangeName ] ) ) { return $ this -> declaredExchangeInstances [ $ exchangeName ] ; } if ( isset ( $ this -> usedExchangeInstances [ $ exchangeName ] ) ) { return $ this -> usedExchangeInstances [ $ exchangeName ] ; } $ this -> ensureChannel ( ) ; $ exchange = new AMQPExchange ( $ this -> channel ) ; $ exchange -> setName ( $ exchangeName ) ; $ this -> usedExchangeInstances [ $ exchangeName ] = $ exchange ; return $ exchange ; }
It returns a cached exchange or a new one if none exists.

@param string $exchangeName

@return AMQPExchange
It returns a cached exchange or a new one if none exists .