anonymous//examples/config.php$1   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 15
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A config.php$0 ➔ createSuccessHandler() 0 13 1
config.php$1 ➔ createSuccessHandler() 0 13 ?
A config.php$0 ➔ __construct() 0 3 1
A config.php$0 ➔ handle() 0 3 1
1
<?php
2
3
namespace Tarantool\JobQueue;
4
5
use Tarantool\JobQueue\Handler\Handler;
6
use Tarantool\Queue\Queue;
7
use Tarantool\Queue\Task;
8
9
return new class extends DefaultConfigFactory
10
{
11
    public function createSuccessHandler(): Handler
12
    {
13
        return new class (parent::createSuccessHandler()) implements Handler {
14
            private $handler;
15
16
            public function __construct(Handler $handler)
17
            {
18
                $this->handler = $handler;
19
            }
20
21
            public function handle(Task $task, Queue $queue): void
22
            {
23
                $this->handler->handle($task, $queue);
24
25
                // do something extra here
26
            }
27
        };
28
    }
29
};
30