CallbackHandler::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace AsyncPHP\Doorman\Handler;
4
5
use AsyncPHP\Doorman\Handler;
6
use AsyncPHP\Doorman\Task;
7
8
final class CallbackHandler implements Handler
9
{
10
    /**
11
     * @inheritdoc
12
     *
13
     * @param Task $task
14
     */
15 1
    public function handle(Task $task)
16
    {
17 1
        $data = $task->getData();
18
19 1
        if (isset($data["closure"])) {
20 1
            $closure = $data["closure"];
21 1
            $closure($this, $task);
22 1
        }
23 1
    }
24
}
25