1 | <?php |
||
12 | class ClosureHandler extends Handler implements RouteHandlerInterface |
||
13 | { |
||
14 | |||
15 | protected $preResponse; |
||
16 | protected $closure; |
||
17 | protected $resolved = null; |
||
18 | |||
19 | /** |
||
20 | * @param string $preResponse |
||
21 | * @param callable $closure |
||
22 | * @return Closure |
||
23 | */ |
||
24 | public static function add($preResponse = '', callable $closure){ |
||
27 | |||
28 | /** |
||
29 | * Closure constructor. |
||
30 | * @param string $preResponse |
||
31 | * @param callable $closure |
||
32 | */ |
||
33 | public function __construct($preResponse = '', callable $closure) |
||
38 | |||
39 | /** |
||
40 | * @param array $vars |
||
41 | * @return mixed |
||
42 | * @throws \Exception |
||
43 | */ |
||
44 | function getResponse($vars = []) |
||
51 | |||
52 | /** |
||
53 | * @param array ...$arguments |
||
54 | */ |
||
55 | function resolve(...$arguments) |
||
59 | } |
||
60 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.