CallbackHandler::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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