Passed
Pull Request — master (#140)
by Alexander
05:08 queued 02:34
created

QueueWorkerInterfaceProxy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector;
6
7
use Yiisoft\Yii\Queue\Message\MessageInterface;
8
use Yiisoft\Yii\Queue\QueueInterface;
9
use Yiisoft\Yii\Queue\Worker\WorkerInterface;
10
11
final class QueueWorkerInterfaceProxy implements WorkerInterface
12
{
13
    public function __construct(
14
        private WorkerInterface $worker,
15
        private QueueCollector $collector,
16
    ) {
17
    }
18
19
    public function process(MessageInterface $message, QueueInterface $queue): void
20
    {
21
        $this->collector->collectWorkerProcessing($message, $queue);
22
        $this->worker->process($message, $queue);
23
    }
24
}
25