Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “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? Sign in to your account

Rewrite middlewares #97

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 6 additions & 5 deletions src/Middleware/DelayMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
use Yiisoft\Queue\AMQP\QueueProviderInterface;
use Yiisoft\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Queue\Middleware\MessageHandlerInterface;
use Yiisoft\Queue\Middleware\MiddlewareInterface;
use Yiisoft\Queue\Middleware\Push\Implementation\DelayMiddlewareInterface;
use Yiisoft\Queue\Middleware\Push\MessageHandlerPushInterface;
use Yiisoft\Queue\Middleware\Push\PushRequest;
use Yiisoft\Queue\Middleware\Request;

final class DelayMiddleware implements DelayMiddlewareInterface
final class DelayMiddleware implements MiddlewareInterface, DelayMiddlewareInterface

Check failure on line 19 in src/Middleware/DelayMiddleware.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.0-ubuntu-latest

UndefinedClass

src/Middleware/DelayMiddleware.php:19:40: UndefinedClass: Class, interface or enum named Yiisoft\Queue\Middleware\MiddlewareInterface does not exist (see https://psalm.dev/019)

Check failure on line 19 in src/Middleware/DelayMiddleware.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedClass

src/Middleware/DelayMiddleware.php:19:40: UndefinedClass: Class, interface or enum named Yiisoft\Queue\Middleware\MiddlewareInterface does not exist (see https://psalm.dev/019)
{
public function __construct(private float $delayInSeconds, private bool $forcePersistentMessages = true)
{
Expand All @@ -39,7 +40,7 @@
return $this->delayInSeconds;
}

public function processPush(PushRequest $request, MessageHandlerPushInterface $handler): PushRequest
public function process(Request $request, MessageHandlerInterface $handler): Request
{
$adapter = $request->getAdapter();
if (!$adapter instanceof Adapter) {
Expand All @@ -60,7 +61,7 @@
->withQueueSettings($queueSettings)
);

return $handler->handlePush($request->withAdapter($adapter));
return $handler->handle($request->withAdapter($adapter));
}

/**
Expand Down
Loading