1 | <?php |
||
22 | class StaticMethod implements ActionReferenceInterface |
||
23 | { |
||
24 | /** |
||
25 | * FQCN which static method is used as an action |
||
26 | * |
||
27 | * @var string|null |
||
28 | */ |
||
29 | private $className; |
||
30 | |||
31 | /** |
||
32 | * Method name used as action |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $methodName; |
||
37 | |||
38 | /** |
||
39 | * Action type |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $type; |
||
44 | |||
45 | /** |
||
46 | * Action method reflection |
||
47 | * |
||
48 | * @var ReflectionMethod |
||
49 | */ |
||
50 | private $reflectionMethod; |
||
51 | |||
52 | /** |
||
53 | * ActionReference constructor. |
||
54 | * |
||
55 | * @param string $methodName method name |
||
56 | * @param string $className FQCN of the class which method is used as an action |
||
57 | * @param string $type action reference type |
||
58 | */ |
||
59 | public function __construct($methodName, $className, $type = self::TYPE_REGULAR) |
||
65 | |||
66 | /** |
||
67 | * Returns action type |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getType() |
||
75 | |||
76 | /** |
||
77 | * Invokes action |
||
78 | * |
||
79 | * @param array $args action args |
||
80 | * |
||
81 | * @return mixed |
||
82 | */ |
||
83 | public function invoke(array $args) |
||
87 | |||
88 | /** |
||
89 | * Returns reflection method |
||
90 | * |
||
91 | * @return ReflectionMethod |
||
92 | */ |
||
93 | private function getReflectionMethod() |
||
101 | } |