Issues (13)

src/Component/Event/CallbackEvent.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace pjpawel\LightApi\Component\Event;
4
5
class CallbackEvent implements EventInterface
6
{
7
8
    private \Closure $closure;
9
    private array $arguments;
10
11
    public function __construct(callable $function, array $arguments = [])
12
    {
13
        $this->closure = $function(...);
0 ignored issues
show
A parse error occurred: Syntax error, unexpected ')' on line 13 at column 38
Loading history...
14
        $this->arguments = $arguments;
15
    }
16
17
    public function run(): mixed
18
    {
19
        return call_user_func($this->closure, $this->arguments);
20
    }
21
}