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

ResponderFactory::makeValidator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
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