-
Notifications
You must be signed in to change notification settings - Fork 439
fixed NS #194
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? No Sign in to your account
fixed NS #194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,11 @@ | |
|
||
namespace Enqueue\AmqpExt; | ||
|
||
use Interop\Amqp\AmqpConsumer; | ||
use Interop\Amqp\AmqpDestination; | ||
use Interop\Amqp\AmqpMessage; | ||
use Interop\Amqp\AmqpQueue; | ||
use Interop\Amqp\AmqpTopic; | ||
use Interop\Amqp\AmqpConsumer as InteropAmqpConsumer; | ||
use Interop\Amqp\AmqpDestination as InteropAmqpDestination; | ||
use Interop\Amqp\AmqpMessage as InteropAmqpMessage; | ||
use Interop\Amqp\AmqpQueue as InteropAmqpQueue; | ||
use Interop\Amqp\AmqpTopic as InteropAmqpTopic; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we get rid of these imports and use Same goes to other imported interfaces There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could, but the same I did above has been done in other classes. |
||
|
||
class Flags | ||
{ | ||
|
@@ -19,11 +19,11 @@ public static function convertMessageFlags($interop) | |
{ | ||
$flags = AMQP_NOPARAM; | ||
|
||
if ($interop & AmqpMessage::FLAG_MANDATORY) { | ||
if ($interop & InteropAmqpMessage::FLAG_MANDATORY) { | ||
$flags |= AMQP_MANDATORY; | ||
} | ||
|
||
if ($interop & AmqpMessage::FLAG_IMMEDIATE) { | ||
if ($interop & InteropAmqpMessage::FLAG_IMMEDIATE) { | ||
$flags |= AMQP_IMMEDIATE; | ||
} | ||
|
||
|
@@ -41,7 +41,7 @@ public static function convertTopicFlags($interop) | |
|
||
$flags |= static::convertDestinationFlags($interop); | ||
|
||
if ($interop & AmqpTopic::FLAG_INTERNAL) { | ||
if ($interop & InteropAmqpTopic::FLAG_INTERNAL) { | ||
$flags |= AMQP_INTERNAL; | ||
} | ||
|
||
|
@@ -59,7 +59,7 @@ public static function convertQueueFlags($interop) | |
|
||
$flags |= static::convertDestinationFlags($interop); | ||
|
||
if ($interop & AmqpQueue::FLAG_EXCLUSIVE) { | ||
if ($interop & InteropAmqpQueue::FLAG_EXCLUSIVE) { | ||
$flags |= AMQP_EXCLUSIVE; | ||
} | ||
|
||
|
@@ -75,19 +75,19 @@ public static function convertDestinationFlags($interop) | |
{ | ||
$flags = AMQP_NOPARAM; | ||
|
||
if ($interop & AmqpDestination::FLAG_PASSIVE) { | ||
if ($interop & InteropAmqpDestination::FLAG_PASSIVE) { | ||
$flags |= AMQP_PASSIVE; | ||
} | ||
|
||
if ($interop & AmqpDestination::FLAG_DURABLE) { | ||
if ($interop & InteropAmqpDestination::FLAG_DURABLE) { | ||
$flags |= AMQP_DURABLE; | ||
} | ||
|
||
if ($interop & AmqpDestination::FLAG_AUTODELETE) { | ||
if ($interop & InteropAmqpDestination::FLAG_AUTODELETE) { | ||
$flags |= AMQP_AUTODELETE; | ||
} | ||
|
||
if ($interop & AmqpDestination::FLAG_NOWAIT) { | ||
if ($interop & InteropAmqpDestination::FLAG_NOWAIT) { | ||
$flags |= AMQP_NOWAIT; | ||
} | ||
|
||
|
@@ -103,19 +103,19 @@ public static function convertConsumerFlags($interop) | |
{ | ||
$flags = AMQP_NOPARAM; | ||
|
||
if ($interop & AmqpConsumer::FLAG_NOLOCAL) { | ||
if ($interop & InteropAmqpConsumer::FLAG_NOLOCAL) { | ||
$flags |= AMQP_NOLOCAL; | ||
} | ||
|
||
if ($interop & AmqpConsumer::FLAG_NOACK) { | ||
if ($interop & InteropAmqpConsumer::FLAG_NOACK) { | ||
$flags |= AMQP_AUTOACK; | ||
} | ||
|
||
if ($interop & AmqpConsumer::FLAG_EXCLUSIVE) { | ||
if ($interop & InteropAmqpConsumer::FLAG_EXCLUSIVE) { | ||
$flags |= AMQP_EXCLUSIVE; | ||
} | ||
|
||
if ($interop & AmqpConsumer::FLAG_NOWAIT) { | ||
if ($interop & InteropAmqpConsumer::FLAG_NOWAIT) { | ||
$flags |= AMQP_NOWAIT; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be enought to remove this single line
use Interop\Amqp\AmqpConsumer;
. It must work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since AmqpConsumer from Enqueue implements InteropAmqpConsumer, it should work indeed! I'm gonna give it a quick test and keep you posted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works! Confirmed by testing on 5.6.31. Should work on other versions as well. let's go for it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chdeliens great! Could you please update the PR?