<?php

namespace Enqueue\Consumption;

use Interop\Queue\Context;
use Interop\Queue\Processor;
use Interop\Queue\Queue as InteropQueue;

interface QueueConsumerInterface
{
    /**
     * In milliseconds.
     */
    public function setReceiveTimeout(int $timeout): void;

    /**
     * In milliseconds.
     */
    public function getReceiveTimeout(): int;

    public function getContext(): Context;

    /**
     * @param string|InteropQueue $queueName
     */
    public function bind($queueName, Processor $processor): self;

    /**
     * @param string|InteropQueue $queueName
     * @param mixed               $queue
     */
    public function bindCallback($queue, callable $processor): self;

    /**
     * Runtime extension - is an extension or a collection of extensions which could be set on runtime.
     * Here's a good example: @see LimitsExtensionsCommandTrait.
     *
     * @param ExtensionInterface|null $runtimeExtension
     *
     * @throws \Exception
     */
    public function consume(ExtensionInterface $runtimeExtension = null): void;
}

<?php

namespace Enqueue\Consumption;

use Interop\Queue\Context;
use Interop\Queue\Processor;
use Interop\Queue\Queue as InteropQueue;

interface QueueConsumerInterface
{
    /**
     * In milliseconds.
     */
    public function setReceiveTimeout(int $timeout): void;

    /**
     * In milliseconds.
     */
    public function getReceiveTimeout(): int;

    public function getContext(): Context;

    /**
     * @param string|InteropQueue $queueName
     */
    public function bind($queueName, Processor $processor): self;

    /**
     * @param string|InteropQueue $queueName
     */
    public function bindCallback($queueName, callable $processor): self;

    /**
     * Runtime extension - is an extension or a collection of extensions which could be set on runtime.
     * Here's a good example: @see LimitsExtensionsCommandTrait.
     *
     * @param ExtensionInterface|null $runtimeExtension
     *
     * @throws \Exception
     */
    public function consume(ExtensionInterface $runtimeExtension = null): void;
}

Fix deprecation notice: The method bindCallback will require a new argument in next major version
Fix deprecation notice: The method bindCallback will require a new argument in next major version

back_consumer_1   | consumer1 | [2019-05-24 12:57:13] php.INFO: User
Deprecated: The "Enqueue\Consumption\QueueConsumer::bindCallback()"
method will require a new "string|InteropQueue $queueName" argument in
the next major version of its parent class
"Enqueue\Consumption\QueueConsumerInterface", not defining it is
deprecated. {"exception":"[object] (ErrorException(code: 0): User
Deprecated: The \"Enqueue\\Consumption\\QueueConsumer::bindCallback()\"
method will require a new \"string|InteropQueue $queueName\" argument in
the next major version of its parent class
\"Enqueue\\Consumption\\QueueConsumerInterface\", not defining it is
deprecated. at /app/vendor/symfony/debug/DebugClassLoader.php:199)"} []
