ControllerEvent::arguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jarvis\Skill\EventBroadcaster;
6
7
/**
8
 * @author Eric Chau <[email protected]>
9
 */
10
class ControllerEvent extends SimpleEvent
11
{
12
    private $callback;
13
    private $arguments;
14
15
    public function __construct($callback, array $arguments = [])
16
    {
17
        $this->callback = $callback;
18
        $this->arguments = $arguments;
19
    }
20
21
    /**
22
     * @codeCoverageIgnore
23
     *
24
     * @return mixed
25
     */
26
    public function callback()
27
    {
28
        return $this->callback;
29
    }
30
31
    /**
32
     * @codeCoverageIgnore
33
     *
34
     * Set new callback to ControllerEvent. It must be callable.
35
     *
36
     * @param mixed $callback
37
     */
38
    public function setCallback($callback): void
39
    {
40
        $this->callback = $callback;
41
    }
42
43
    /**
44
     * @codeCoverageIgnore
45
     *
46
     * @return array
47
     */
48
    public function arguments(): array
49
    {
50
        return $this->arguments;
51
    }
52
53
    /**
54
     * @codeCoverageIgnore
55
     *
56
     * Sets new list of arguments to ControllerEvent.
57
     *
58
     * @param array $arguments
59
     */
60
    public function setArguments(array $arguments = []): void
61
    {
62
        $this->arguments = $arguments;
63
    }
64
}
65