Passed
Push — master ( 88940e...c2bb1d )
by Paweł
12:37
created

DefinedFunctionEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace pjpawel\LightApi\Component\Event;
4
5
class DefinedFunctionEvent implements EventInterface
6
{
7
8
    private string $functionName;
9
    private array $arguments;
10
11
    public function __construct(string $functionName, $arguments)
12
    {
13
        $this->functionName = $functionName;
14
        $this->arguments = $arguments;
15
    }
16
17
    public function run(): mixed
18
    {
19
        return call_user_func($this->functionName, $this->arguments);
20
    }
21
}