1 | <?php |
||
19 | class Delegate extends AbstractCallable |
||
20 | { |
||
21 | /** |
||
22 | * @var \ReflectionFunction|\ReflectionMethod |
||
23 | */ |
||
24 | private $reflection = null; |
||
25 | |||
26 | /** |
||
27 | * @var callable |
||
28 | */ |
||
29 | protected $callable; |
||
30 | |||
31 | /** |
||
32 | * @param Closure $closure |
||
33 | * |
||
34 | * @return static |
||
35 | */ |
||
36 | public static function fromClosure(\Closure $closure) |
||
40 | |||
41 | /** |
||
42 | * @param object $object |
||
43 | * @param string $method |
||
44 | * |
||
45 | * @return static |
||
46 | */ |
||
47 | public static function fromMethod($object, $method) |
||
51 | |||
52 | /** |
||
53 | * @param string $class |
||
54 | * @param string $method |
||
55 | * |
||
56 | * @return static |
||
57 | */ |
||
58 | public static function fromStaticMethod($class, $method) |
||
62 | |||
63 | /** |
||
64 | * @param string $function |
||
65 | * |
||
66 | * @return static |
||
67 | */ |
||
68 | public static function fromFunction($function) |
||
72 | |||
73 | /** |
||
74 | * @param callable $callable |
||
75 | */ |
||
76 | public function __construct($callable) |
||
88 | |||
89 | /** |
||
90 | * @return \ReflectionFunction|\ReflectionMethod |
||
91 | */ |
||
92 | public function reflection() |
||
106 | |||
107 | /** |
||
108 | * @return callable |
||
109 | */ |
||
110 | public function getCallable() |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | protected function innerCallable() |
||
122 | } |
||
123 |