src/Bunny/Channel.php
public function publish($body, array $headers = [], $exchange = '', $routingKey = '', $mandatory = false, $immediate = false)
    {
        $response = $this->publishImpl($body, $headers, $exchange, $routingKey, $mandatory, $immediate);

        if ($this->mode === ChannelModeEnum::CONFIRM) {
            if ($response instanceof PromiseInterface) {
                return $response->then(function () {
                    return ++$this->deliveryTag;
                });
            } else {
                return ++$this->deliveryTag;
            }
        } else {
            return $response;
        }
    }
public function publish($body, array $headers = [], $exchange = '', $routingKey = '', $mandatory = false, $immediate = false)
    {
        $response = $this->publishImpl($body, $headers, $exchange, $routingKey, $mandatory, $immediate);

        if ($this->mode === ChannelModeEnum::CONFIRM) {
            if ($response instanceof PromiseInterface) {
                return $response->then(function () {
                    return ++$this->deliveryTag;
                });
            } else {
                return ++$this->deliveryTag;
            }
        } else {
            return $response;
        }
    }
public function publish ( $ body , array $ headers = [ ] , $ exchange = '' , $ routingKey = '' , $ mandatory = false , $ immediate = false ) { $ response = $ this -> publishImpl ( $ body , $ headers , $ exchange , $ routingKey , $ mandatory , $ immediate ) ; if ( $ this -> mode === ChannelModeEnum :: CONFIRM ) { if ( $ response instanceof PromiseInterface ) { return $ response -> then ( function ( ) { return ++ $ this -> deliveryTag ; } ) ; } else { return ++ $ this -> deliveryTag ; } } else { return $ response ; } }
Published message to given exchange.

@param string $body
@param array $headers
@param string $exchange
@param string $routingKey
@param bool $mandatory
@param bool $immediate
@return bool|PromiseInterface|int
Published message to given exchange .