Conditions | 2 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function after($callback) |
||
32 | { |
||
33 | $container = Container::getInstance(); |
||
34 | |||
35 | $this->on('after', function ($request, $response) use (&$container, &$callback) { |
||
36 | try { |
||
37 | $container->call($callback, func_get_args()); |
||
38 | } catch (\Exception $e) { |
||
39 | $this->emit('error', [$request, $response, $e->getMessage()]); |
||
40 | } |
||
41 | }); |
||
42 | } |
||
43 | } |