Skip to content

Commit 1dd9782

Browse files
committed
Merge remote-tracking branch 'origin/master' into merge08
2 parents 4780255 + f52b11a commit 1dd9782

23 files changed

+165
-885
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ git:
66
language: php
77

88
php:
9-
- '5.6'
10-
- '7.0'
9+
- '7.1'
10+
- '7.2'
1111

1212
cache:
1313
directories:

Client/NullDriver.php

Lines changed: 0 additions & 160 deletions
This file was deleted.

NullConnectionFactory.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Enqueue\Null;
46

5-
use Interop\Queue\PsrConnectionFactory;
7+
use Interop\Queue\ConnectionFactory;
8+
use Interop\Queue\Context;
69

7-
class NullConnectionFactory implements PsrConnectionFactory
10+
class NullConnectionFactory implements ConnectionFactory
811
{
912
/**
10-
* {@inheritdoc}
13+
* @return NullContext
1114
*/
12-
public function createContext()
15+
public function createContext(): Context
1316
{
1417
return new NullContext();
1518
}

NullConsumer.php

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,52 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Enqueue\Null;
46

5-
use Interop\Queue\PsrConsumer;
6-
use Interop\Queue\PsrDestination;
7-
use Interop\Queue\PsrMessage;
7+
use Interop\Queue\Consumer;
8+
use Interop\Queue\Destination;
9+
use Interop\Queue\Message;
10+
use Interop\Queue\Queue;
811

9-
class NullConsumer implements PsrConsumer
12+
class NullConsumer implements Consumer
1013
{
1114
/**
12-
* @var PsrDestination
15+
* @var Destination
1316
*/
1417
private $queue;
1518

16-
/**
17-
* @param PsrDestination $queue
18-
*/
19-
public function __construct(PsrDestination $queue)
19+
public function __construct(Destination $queue)
2020
{
2121
$this->queue = $queue;
2222
}
2323

24-
/**
25-
* {@inheritdoc}
26-
*/
27-
public function getQueue()
24+
public function getQueue(): Queue
2825
{
2926
return $this->queue;
3027
}
3128

3229
/**
33-
* {@inheritdoc}
30+
* @return NullMessage
3431
*/
35-
public function receive($timeout = 0)
32+
public function receive(int $timeout = 0): ?Message
3633
{
3734
return null;
3835
}
3936

4037
/**
41-
* {@inheritdoc}
38+
* @return NullMessage
4239
*/
43-
public function receiveNoWait()
40+
public function receiveNoWait(): ?Message
4441
{
4542
return null;
4643
}
4744

48-
/**
49-
* {@inheritdoc}
50-
*/
51-
public function acknowledge(PsrMessage $message)
45+
public function acknowledge(Message $message): void
5246
{
5347
}
5448

55-
/**
56-
* {@inheritdoc}
57-
*/
58-
public function reject(PsrMessage $message, $requeue = false)
49+
public function reject(Message $message, bool $requeue = false): void
5950
{
6051
}
6152
}

NullContext.php

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Enqueue\Null;
46

5-
use Interop\Queue\PsrContext;
6-
use Interop\Queue\PsrDestination;
7+
use Interop\Queue\Consumer;
8+
use Interop\Queue\Context;
9+
use Interop\Queue\Destination;
10+
use Interop\Queue\Message;
11+
use Interop\Queue\Producer;
12+
use Interop\Queue\Queue;
13+
use Interop\Queue\SubscriptionConsumer;
14+
use Interop\Queue\Topic;
715

8-
class NullContext implements PsrContext
16+
class NullContext implements Context
917
{
1018
/**
11-
* {@inheritdoc}
12-
*
1319
* @return NullMessage
1420
*/
15-
public function createMessage($body = null, array $properties = [], array $headers = [])
21+
public function createMessage(string $body = '', array $properties = [], array $headers = []): Message
1622
{
1723
$message = new NullMessage();
1824
$message->setBody($body);
@@ -23,55 +29,58 @@ public function createMessage($body = null, array $properties = [], array $heade
2329
}
2430

2531
/**
26-
* {@inheritdoc}
27-
*
2832
* @return NullQueue
2933
*/
30-
public function createQueue($name)
34+
public function createQueue(string $name): Queue
3135
{
3236
return new NullQueue($name);
3337
}
3438

3539
/**
36-
* {@inheritdoc}
40+
* @return NullQueue
3741
*/
38-
public function createTemporaryQueue()
42+
public function createTemporaryQueue(): Queue
3943
{
4044
return $this->createQueue(uniqid('', true));
4145
}
4246

4347
/**
44-
* {@inheritdoc}
45-
*
4648
* @return NullTopic
4749
*/
48-
public function createTopic($name)
50+
public function createTopic(string $name): Topic
4951
{
5052
return new NullTopic($name);
5153
}
5254

5355
/**
54-
* {@inheritdoc}
55-
*
5656
* @return NullConsumer
5757
*/
58-
public function createConsumer(PsrDestination $destination)
58+
public function createConsumer(Destination $destination): Consumer
5959
{
6060
return new NullConsumer($destination);
6161
}
6262

6363
/**
64-
* {@inheritdoc}
64+
* @return NullProducer
6565
*/
66-
public function createProducer()
66+
public function createProducer(): Producer
6767
{
6868
return new NullProducer();
6969
}
7070

7171
/**
72-
* {@inheritdoc}
72+
* @return NullSubscriptionConsumer
7373
*/
74-
public function close()
74+
public function createSubscriptionConsumer(): SubscriptionConsumer
75+
{
76+
return new NullSubscriptionConsumer();
77+
}
78+
79+
public function purgeQueue(Queue $queue): void
80+
{
81+
}
82+
83+
public function close(): void
7584
{
7685
}
7786
}

0 commit comments

Comments
 (0)