| Conditions | 2 |
| Paths | 3 |
| Total Lines | 27 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function __invoke($template_pathname, $thisArg, array $variables, array $options = []) |
||
| 23 | { |
||
| 24 | $f = \Closure::bind(function($__TEMPLATE_PATHNAME__, $__VARIABLES__) { |
||
| 25 | |||
| 26 | unset($__VARIABLES__['this']); |
||
| 27 | |||
| 28 | extract($__VARIABLES__); |
||
| 29 | |||
| 30 | require $__TEMPLATE_PATHNAME__; |
||
| 31 | |||
| 32 | }, $this->ensure_is_object($thisArg)); |
||
| 33 | |||
| 34 | ob_start(); |
||
| 35 | |||
| 36 | try |
||
| 37 | { |
||
| 38 | $f($template_pathname, [ self::VAR_TEMPLATE_PATHNAME => $template_pathname ] + $variables); |
||
| 39 | |||
| 40 | return ob_get_clean(); |
||
| 41 | } |
||
| 42 | catch (\Exception $e) |
||
| 43 | { |
||
| 44 | ob_end_clean(); |
||
| 45 | |||
| 46 | throw $e; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 76 |