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

MethodEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 3 1
A __construct() 0 5 1
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
}