Skip to content

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

Merged
merged 1 commit into from
Sep 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions pkg/amqp-ext/Flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Enqueue\AmqpExt;

use Interop\Amqp\AmqpConsumer;
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 :)

Copy link
Member

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?

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;
Copy link
Member

@makasim makasim Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we get rid of these imports and use Enqueue\AmqpExt\AmqpConsumer instead.

Same goes to other imported interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
I suggest to keep it that way for now and refactor mid-term. What do you think?


class Flags
{
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down