1 | <?php |
||
12 | class TimedTwigDecorator extends \Twig_Environment{ |
||
13 | /** |
||
14 | * @var \Twig_Environment |
||
15 | */ |
||
16 | private $environment; |
||
17 | /** |
||
18 | * @var Stopwatch |
||
19 | */ |
||
20 | private $stopwatch; |
||
21 | |||
22 | /** |
||
23 | * @param \Twig_Environment $environment |
||
24 | * @param Stopwatch $stopwatch |
||
25 | */ |
||
26 | public function __construct(\Twig_Environment $environment, Stopwatch $stopwatch) |
||
31 | |||
32 | /** |
||
33 | * Renders a template. |
||
34 | * |
||
35 | * @param string $name The template name |
||
36 | * @param array $context An array of parameters to pass to the template |
||
37 | * |
||
38 | * @return string The rendered template |
||
39 | * |
||
40 | * @throws \Twig_Error_Loader When the template cannot be found |
||
41 | * @throws \Twig_Error_Syntax When an error occurred during compilation |
||
42 | * @throws \Twig_Error_Runtime When an error occurred during rendering |
||
43 | */ |
||
44 | public function render($name, array $context = array()) |
||
59 | |||
60 | /** |
||
61 | * is triggered when invoking inaccessible methods in an object context. |
||
62 | * |
||
63 | * @param $name string |
||
64 | * @param $arguments array |
||
65 | * @return mixed |
||
66 | * @link http://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods |
||
67 | */ |
||
68 | function __call($name, $arguments) |
||
72 | |||
73 | |||
74 | } |
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.