Skip to content

Commit ddb655d

Browse files
committed
Merge branch 'master' into horizon
2 parents d6ae730 + 22fada9 commit ddb655d

File tree

5 files changed

+36
-33
lines changed

5 files changed

+36
-33
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"illuminate/database": "5.6.*|5.7.*|5.8.*",
1515
"illuminate/support": "5.6.*|5.7.*|5.8.*",
1616
"illuminate/queue": "5.6.*|5.7.*|5.8.*",
17-
"enqueue/amqp-lib": "0.8.*",
18-
"queue-interop/amqp-interop": "^0.7"
17+
"enqueue/amqp-lib": "0.9.*",
18+
"queue-interop/amqp-interop": "0.8.*"
1919
},
2020
"require-dev": {
2121
"phpunit/phpunit": "^7.0",

tests/Mock/AmqpConnectionFactorySpy.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace VladimirYuldashev\LaravelQueueRabbitMQ\Tests\Mock;
44

5+
use Interop\Queue\Context;
6+
57
class AmqpConnectionFactorySpy implements \Interop\Amqp\AmqpConnectionFactory
68
{
79
/** @var \Closure */
@@ -14,7 +16,7 @@ public function __construct($config)
1416
$spy($config);
1517
}
1618

17-
public function createContext()
19+
public function createContext(): Context
1820
{
1921
return new AmqpContextMock();
2022
}

tests/Mock/AmqpContextMock.php

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,97 +6,93 @@
66
use Interop\Amqp\AmqpQueue;
77
use Interop\Amqp\AmqpTopic;
88
use Interop\Amqp\AmqpContext;
9-
use Interop\Amqp\AmqpConsumer;
10-
use Interop\Queue\PsrDestination;
9+
use Interop\Queue\Consumer;
10+
use Interop\Queue\Destination;
11+
use Interop\Queue\Message;
12+
use Interop\Queue\Producer;
13+
use Interop\Queue\Queue;
14+
use Interop\Queue\SubscriptionConsumer;
15+
use Interop\Queue\Topic;
1116

1217
class AmqpContextMock implements AmqpContext
1318
{
14-
public function declareTopic(AmqpTopic $topic)
19+
public function createSubscriptionConsumer(): SubscriptionConsumer
1520
{
1621
throw new \LogicException('It is not expected to be called');
1722
}
1823

19-
public function deleteTopic(AmqpTopic $topic)
24+
public function declareTopic(AmqpTopic $topic): void
2025
{
2126
throw new \LogicException('It is not expected to be called');
2227
}
2328

24-
public function declareQueue(AmqpQueue $queue)
29+
public function deleteTopic(AmqpTopic $topic): void
2530
{
2631
throw new \LogicException('It is not expected to be called');
2732
}
2833

29-
public function deleteQueue(AmqpQueue $queue)
34+
public function declareQueue(AmqpQueue $queue): int
3035
{
3136
throw new \LogicException('It is not expected to be called');
3237
}
3338

34-
public function purgeQueue(AmqpQueue $queue)
39+
public function deleteQueue(AmqpQueue $queue): void
3540
{
3641
throw new \LogicException('It is not expected to be called');
3742
}
3843

39-
public function bind(AmqpBind $bind)
44+
public function purgeQueue(Queue $queue): void
4045
{
4146
throw new \LogicException('It is not expected to be called');
4247
}
4348

44-
public function unbind(AmqpBind $bind)
49+
public function bind(AmqpBind $bind): void
4550
{
4651
throw new \LogicException('It is not expected to be called');
4752
}
4853

49-
public function setQos($prefetchSize, $prefetchCount, $global)
54+
public function unbind(AmqpBind $bind): void
5055
{
5156
throw new \LogicException('It is not expected to be called');
5257
}
5358

54-
public function subscribe(AmqpConsumer $consumer, callable $callback)
59+
public function setQos(int $prefetchSize, int $prefetchCount, bool $global): void
5560
{
5661
throw new \LogicException('It is not expected to be called');
5762
}
5863

59-
public function unsubscribe(AmqpConsumer $consumer)
60-
{
61-
throw new \LogicException('It is not expected to be called');
62-
}
63-
64-
public function consume($timeout = 0)
65-
{
66-
throw new \LogicException('It is not expected to be called');
67-
}
6864

69-
public function close()
65+
public function close(): void
7066
{
7167
throw new \LogicException('It is not expected to be called');
7268
}
7369

74-
public function createQueue($queueName)
70+
public function createQueue(string $queueName): Queue
7571
{
7672
throw new \LogicException('It is not expected to be called');
7773
}
7874

79-
public function createTemporaryQueue()
75+
public function createTemporaryQueue(): Queue
8076
{
8177
throw new \LogicException('It is not expected to be called');
8278
}
8379

84-
public function createProducer()
80+
public function createProducer(): Producer
8581
{
8682
throw new \LogicException('It is not expected to be called');
8783
}
8884

89-
public function createConsumer(PsrDestination $destination)
85+
public function createConsumer(Destination $destination): Consumer
9086
{
9187
throw new \LogicException('It is not expected to be called');
9288
}
9389

94-
public function createTopic($amqpTopic)
90+
public function createTopic(string $amqpTopic): Topic
9591
{
9692
throw new \LogicException('It is not expected to be called');
9793
}
9894

99-
public function createMessage($body = '', array $properties = [], array $headers = [])
95+
public function createMessage(string $body = '', array $properties = [], array $headers = []): Message
10096
{
10197
throw new \LogicException('It is not expected to be called');
10298
}

tests/Mock/CustomContextAmqpConnectionFactoryMock.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace VladimirYuldashev\LaravelQueueRabbitMQ\Tests\Mock;
44

5+
use Interop\Queue\Context;
6+
57
class CustomContextAmqpConnectionFactoryMock implements \Interop\Amqp\AmqpConnectionFactory
68
{
79
public static $context;
810

9-
public function createContext()
11+
public function createContext(): Context
1012
{
1113
return static::$context;
1214
}

tests/Mock/DelayStrategyAwareAmqpConnectionFactorySpy.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
use Enqueue\AmqpTools\DelayStrategy;
66
use Enqueue\AmqpTools\DelayStrategyAware;
7+
use Interop\Queue\Context;
78

89
class DelayStrategyAwareAmqpConnectionFactorySpy implements \Interop\Amqp\AmqpConnectionFactory, DelayStrategyAware
910
{
1011
/** @var \Closure */
1112
public static $spy;
1213

13-
public function createContext()
14+
public function createContext(): Context
1415
{
1516
return new AmqpContextMock();
1617
}
@@ -20,10 +21,12 @@ public function createContext()
2021
*
2122
* @return self
2223
*/
23-
public function setDelayStrategy(DelayStrategy $delayStrategy = null)
24+
public function setDelayStrategy(DelayStrategy $delayStrategy = null): DelayStrategyAware
2425
{
2526
$spy = static::$spy;
2627

2728
$spy($delayStrategy);
29+
30+
return $this;
2831
}
2932
}

0 commit comments

Comments
 (0)