CallableListener::call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
namespace Wandu\Event\Listener;
3
4
use Wandu\Event\Contracts\Listener;
5
6
class CallableListener implements Listener
7
{
8
    /** @var callable */
9
    protected $handler;
10
    
11 5
    public function __construct(callable $handler)
12
    {
13 5
        $this->handler = $handler;
14 5
    }
15
16
    /**
17
     * {@inheritdoc}
18
     */
19 5
    public function call(array $arguments = [])
20
    {
21 5
        call_user_func_array($this->handler, $arguments);
22 5
    }
23
}
24