Passed
Push — master ( 685e2a...9f4f72 )
by Iman
03:13
created

ResponderFactory::sendResponse()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

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