Passed
Push — master ( dbe0e9...183c61 )
by Sergei
03:16
created

DummyQueue   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 8
eloc 6
c 3
b 0
f 0
dl 0
loc 39
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A withAdapter() 0 3 1
A run() 0 2 1
A listen() 0 2 1
A __construct() 0 2 1
A status() 0 3 1
A getChannelName() 0 3 1
A push() 0 5 1
A withChannelName() 0 3 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