ResponderFactory::make()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 4
c 2
b 1
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\Reactions;
4
5
use Imanghafoori\HeyMan\Plugins\Reactions\Nothing;
6
7
final class ResponderFactory
8
{
9 106
    public function make()
10
    {
11 106
        $chain = resolve('heyman.chain');
12 106
        $method = $chain->get('responseType') ?? [Nothing::class, 'nothing'];
13 106
        $data = $chain->get('data') ?? [];
14
15 106
        return call_user_func($method, ...$data);
16
    }
17
}
18