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

MethodEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
1
<?php
2
3
namespace pjpawel\LightApi\Component\Event;
4
5
class MethodEvent implements EventInterface
6
{
7
8
    private string|object $className;
9
    private string $methodName;
10
    private array $arguments;
11
12
    public function __construct(string|object $className, string $methodName, array $arguments)
13
    {
14
        $this->className = $className;
15
        $this->methodName = $methodName;
16
        $this->arguments = $arguments;
17
    }
18
19
    public function run(): mixed
20
    {
21
        return call_user_func([$this->className, $this->methodName], $this->arguments);
22
    }
23
}