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

DefinedFunctionEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
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
}