Passed
Pull Request — master (#199)
by Sergei
07:25 queued 04:52
created

DummyQueue::withChannelName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Tests\Support;
6
7
use Exception;
8
use Yiisoft\Yii\Queue\Adapter\AdapterInterface;
9
use Yiisoft\Yii\Queue\Enum\JobStatus;
10
use Yiisoft\Yii\Queue\Message\MessageInterface;
11
use Yiisoft\Yii\Queue\Middleware\Push\MiddlewarePushInterface;
12
use Yiisoft\Yii\Queue\QueueInterface;
13
14
final class DummyQueue implements QueueInterface
15
{
16
    public function __construct(private $channelName)
17
    {
18
    }
19
20
    public function push(
21
        MessageInterface $message,
22
        string|array|callable|MiddlewarePushInterface ...$middlewareDefinitions
23
    ): MessageInterface {
24
        return $message;
25
    }
26
27
    public function run(int $max = 0): void
28
    {
29
    }
30
31
    public function listen(): void
32
    {
33
    }
34
35
    public function status(string $id): JobStatus
36
    {
37
        throw new Exception('`status()` method is not implemented yet.');
38
    }
39
40
    public function withAdapter(AdapterInterface $adapter): QueueInterface
41
    {
42
        throw new Exception('`withAdapter()` method is not implemented yet.');
43
    }
44
45
    public function getChannelName(): string
46
    {
47
        return $this->channelName;
48
    }
49
50
    public function withChannelName(string $channel): QueueInterface
51
    {
52
        throw new Exception('`withChannelName()` method is not implemented yet.');
53
    }
54
}
55