Skip to content

Commit

Permalink
Adds PayloadDeserializerInterface to PayloadDeserializer class
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Dec 12, 2023
1 parent 650df60 commit 3c926a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Queue/PayloadDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Spiral\RoadRunner\Jobs\Exception\JobsException;
use Spiral\RoadRunner\Jobs\Task\ReceivedTaskInterface;

final class PayloadDeserializer
final class PayloadDeserializer implements PayloadDeserializerInterface
{
/**
* Cache for detected types.
Expand Down
3 changes: 3 additions & 0 deletions src/Queue/PayloadDeserializerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@

interface PayloadDeserializerInterface
{
/**
* Deserializes the payload of the given task.
*/
public function deserialize(ReceivedTaskInterface $task): mixed;
}
10 changes: 10 additions & 0 deletions tests/src/Bootloader/QueueBootloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Spiral\Core\ConfigsInterface;
use Spiral\Exceptions\ExceptionReporterInterface;
use Spiral\Queue\HandlerRegistryInterface;
use Spiral\RoadRunnerBridge\Queue\PayloadDeserializer;
use Spiral\RoadRunnerBridge\Queue\PayloadDeserializerInterface;
use Spiral\Serializer\SerializerInterface;
use Spiral\RoadRunnerBridge\Queue\Dispatcher;
use Spiral\RoadRunnerBridge\Queue\PipelineRegistryInterface;
Expand Down Expand Up @@ -88,6 +90,14 @@ public function testGetsSerializerInterface(): void
);
}

public function testGetsPayloadDeserializerInterface(): void
{
$this->assertContainerBoundAsSingleton(
PayloadDeserializerInterface::class,
PayloadDeserializer::class
);
}

public function testConfigShouldBeDefined(): void
{
$configurator = $this->getContainer()->get(ConfigsInterface::class);
Expand Down

0 comments on commit 3c926a2

Please sign in to comment.