Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Jan 13, 2024
1 parent 8297902 commit e3a598d
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ $queue->push($message);
Its handler may look like the following:

```php
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Yii\Queue\Message\MessageHandlerInterface;
use Yiisoft\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageHandlerInterface;

class FileDownloader implements MessageHandlerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Message/EnvelopeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function withMessage(MessageInterface $message): self
return $instance;
}

public function getHandlerName(): string
public function getHandler(): string

Check failure on line 24 in src/Message/EnvelopeTrait.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.0-ubuntu-latest

LessSpecificImplementedReturnType

src/Message/EnvelopeTrait.php:24:35: LessSpecificImplementedReturnType: The inherited return type 'class-string<Yiisoft\Queue\Message\MessageHandlerInterface>' for Yiisoft\Queue\Message\MessageInterface::getHandler is more specific than the implemented return type for Yiisoft\Queue\Message\EnvelopeTrait::gethandler 'string' (see https://psalm.dev/166)

Check failure on line 24 in src/Message/EnvelopeTrait.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

LessSpecificImplementedReturnType

src/Message/EnvelopeTrait.php:24:35: LessSpecificImplementedReturnType: The inherited return type 'class-string<Yiisoft\Queue\Message\MessageHandlerInterface>' for Yiisoft\Queue\Message\MessageInterface::getHandler is more specific than the implemented return type for Yiisoft\Queue\Message\EnvelopeTrait::gethandler 'string' (see https://psalm.dev/166)
{
return $this->message->getHandlerName();
return $this->message->getHandler();
}

public function getData(): mixed
Expand Down
2 changes: 1 addition & 1 deletion src/Message/MessageHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\Message;
namespace Yiisoft\Queue\Message;

interface MessageHandlerInterface
{
Expand Down
1 change: 1 addition & 0 deletions src/Middleware/FailureHandling/FailureEnvelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ public function getMetadata(): array
{
return array_merge($this->message->getMetadata(), $this->meta);
}

}
1 change: 1 addition & 0 deletions src/Worker/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Throwable;
use Yiisoft\Injector\Injector;
use Yiisoft\Queue\Exception\JobFailureException;
use Yiisoft\Queue\Message\MessageHandlerInterface;
use Yiisoft\Queue\Message\MessageInterface;
use Yiisoft\Queue\Middleware\Consume\ConsumeFinalHandler;
use Yiisoft\Queue\Middleware\Consume\ConsumeMiddlewareDispatcher;
Expand Down
3 changes: 1 addition & 2 deletions tests/App/FakeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

use Yiisoft\Queue\Message\MessageInterface;
use RuntimeException;
use Yiisoft\Yii\Queue\Message\MessageHandlerInterface;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageHandlerInterface;

final class FakeHandler implements MessageHandlerInterface
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/MessageConsumingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
use Yiisoft\Queue\Middleware\Consume\MiddlewareFactoryConsumeInterface;
use Yiisoft\Queue\Middleware\FailureHandling\FailureMiddlewareDispatcher;
use Yiisoft\Queue\Middleware\FailureHandling\MiddlewareFactoryFailureInterface;
use Yiisoft\Queue\Tests\Support\StackMessageHandler;
use Yiisoft\Queue\Tests\TestCase;
use Yiisoft\Queue\Worker\Worker;
use Yiisoft\Test\Support\Container\SimpleContainer;

final class MessageConsumingTest extends TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/Integration/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Yiisoft\Injector\Injector;
use Yiisoft\Queue\Tests\Support\NullMessageHandler;
use Yiisoft\Test\Support\Container\SimpleContainer;
use Yiisoft\Test\Support\Log\SimpleLogger;
use Yiisoft\Queue\Adapter\SynchronousAdapter;
Expand Down
6 changes: 3 additions & 3 deletions tests/Support/ExceptionMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\Tests\Support;
namespace Yiisoft\Queue\Tests\Support;

use RuntimeException;
use Yiisoft\Yii\Queue\Message\MessageHandlerInterface;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageHandlerInterface;
use Yiisoft\Queue\Message\MessageInterface;

class ExceptionMessageHandler implements MessageHandlerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Support/NullMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\Tests\Support;
namespace Yiisoft\Queue\Tests\Support;

use Yiisoft\Yii\Queue\Message\MessageHandlerInterface;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageHandlerInterface;
use Yiisoft\Queue\Message\MessageInterface;

class NullMessageHandler implements MessageHandlerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Support/StackMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\Tests\Support;
namespace Yiisoft\Queue\Tests\Support;

use Yiisoft\Yii\Queue\Message\MessageHandlerInterface;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageHandlerInterface;
use Yiisoft\Queue\Message\MessageInterface;

class StackMessageHandler implements MessageHandlerInterface
{
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use Yiisoft\Queue\Queue;
use Yiisoft\Queue\Worker\Worker;
use Yiisoft\Queue\Worker\WorkerInterface;
use Yiisoft\Queue\Tests\Support\NullMessageHandler;
use Yiisoft\Queue\Tests\Support\StackMessageHandler;

/**
* Base Test Case.
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Yiisoft\Queue\Tests\App\FakeAdapter;
use Yiisoft\Queue\Tests\TestCase;
use Yiisoft\Queue\Message\IdEnvelope;
use Yiisoft\Queue\Tests\Support\NullMessageHandler;
use Yiisoft\Queue\Tests\Support\StackMessageHandler;

final class QueueTest extends TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/SynchronousAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Yiisoft\Queue\QueueFactory;
use Yiisoft\Queue\Tests\TestCase;
use Yiisoft\Queue\Message\IdEnvelope;
use Yiisoft\Queue\Tests\Support\NullMessageHandler;

final class SynchronousAdapterTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/WorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Yiisoft\Queue\Tests\App\FakeHandler;
use Yiisoft\Queue\Tests\TestCase;
use Yiisoft\Queue\Worker\Worker;
use Yiisoft\Queue\Tests\Support\ExceptionMessageHandler;
use Yiisoft\Queue\Tests\Support\StackMessageHandler;

final class WorkerTest extends TestCase
{
Expand Down

0 comments on commit e3a598d

Please sign in to comment.