Skip to content

Commit 6ac773a

Browse files
committed
[async-command][async-events] Do not use deprecated classes.
1 parent 3586267 commit 6ac773a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

RunCommandProcessor.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
use Enqueue\Client\CommandSubscriberInterface;
66
use Enqueue\Consumption\Result;
7-
use Interop\Queue\PsrContext;
8-
use Interop\Queue\PsrMessage;
9-
use Interop\Queue\PsrProcessor;
7+
use Interop\Queue\Context;
8+
use Interop\Queue\Message;
9+
use Interop\Queue\Processor;
1010
use Symfony\Component\Process\PhpExecutableFinder;
1111
use Symfony\Component\Process\Process;
1212

13-
final class RunCommandProcessor implements PsrProcessor, CommandSubscriberInterface
13+
final class RunCommandProcessor implements Processor, CommandSubscriberInterface
1414
{
1515
/**
1616
* @var string
@@ -22,7 +22,7 @@ public function __construct(string $projectDir)
2222
$this->projectDir = $projectDir;
2323
}
2424

25-
public function process(PsrMessage $message, PsrContext $context): Result
25+
public function process(Message $message, Context $context): Result
2626
{
2727
$command = RunCommand::jsonUnserialize($message->getBody());
2828

Tests/Functional/UseCasesTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Enqueue\Consumption\Result;
99
use Enqueue\Null\NullContext;
1010
use Enqueue\Null\NullMessage;
11-
use Interop\Queue\PsrMessage;
11+
use Interop\Queue\Message;
1212
use PHPUnit\Framework\TestCase;
1313

1414
/**
@@ -20,15 +20,15 @@ public function testRunSimpleCommandAndReturnOutput()
2020
{
2121
$runCommand = new RunCommand('foo');
2222

23-
$psrMessage = new NullMessage(json_encode($runCommand));
24-
$psrMessage->setReplyTo('aReplyToQueue');
23+
$Message = new NullMessage(json_encode($runCommand));
24+
$Message->setReplyTo('aReplyToQueue');
2525

2626
$processor = new RunCommandProcessor(__DIR__);
2727

28-
$result = $processor->process($psrMessage, new NullContext());
28+
$result = $processor->process($Message, new NullContext());
2929

3030
$this->assertInstanceOf(Result::class, $result);
31-
$this->assertInstanceOf(PsrMessage::class, $result->getReply());
31+
$this->assertInstanceOf(Message::class, $result->getReply());
3232

3333
$replyMessage = $result->getReply();
3434

Tests/RunCommandProcessorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Enqueue\AsyncCommand\Commands;
66
use Enqueue\AsyncCommand\RunCommandProcessor;
77
use Enqueue\Client\CommandSubscriberInterface;
8-
use Interop\Queue\PsrProcessor;
8+
use Interop\Queue\Processor;
99
use PHPUnit\Framework\TestCase;
1010

1111
class RunCommandProcessorTest extends TestCase
@@ -14,7 +14,7 @@ public function testShouldImplementProcessorInterface()
1414
{
1515
$rc = new \ReflectionClass(RunCommandProcessor::class);
1616

17-
$this->assertTrue($rc->implementsInterface(PsrProcessor::class));
17+
$this->assertTrue($rc->implementsInterface(Processor::class));
1818
}
1919

2020
public function testShouldImplementCommandSubscriberInterfaceInterface()

0 commit comments

Comments
 (0)