Passed
Pull Request — master (#156)
by Wilmer
06:05 queued 03:57
created

DummyQueue   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 5
dl 0
loc 34
rs 10
c 0
b 0
f 0

7 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
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