diff --git a/CHANGELOG b/CHANGELOG index 7f36cb67b..13b53116c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ * 1.35.2 (2018-XX-XX) - * n/a + * fixed a regression in the way the profiler is registered in templates * 1.35.1 (2018-03-02) diff --git a/lib/Twig/Profiler/NodeVisitor/Profiler.php b/lib/Twig/Profiler/NodeVisitor/Profiler.php index 45253c7e6..5db41fea7 100644 --- a/lib/Twig/Profiler/NodeVisitor/Profiler.php +++ b/lib/Twig/Profiler/NodeVisitor/Profiler.php @@ -55,7 +55,7 @@ class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor private function getVarName() { - return sprintf('__internal_%s', hash('sha256', __METHOD__)); + return sprintf('__internal_%s', hash('sha256', $this->extensionName)); } public function getPriority() diff --git a/lib/Twig/Profiler/Profile.php b/lib/Twig/Profiler/Profile.php index aabf551e8..3fdc1a8ae 100644 --- a/lib/Twig/Profiler/Profile.php +++ b/lib/Twig/Profiler/Profile.php @@ -76,7 +76,7 @@ class Twig_Profiler_Profile implements IteratorAggregate, Serializable return $this->profiles; } - public function addProfile(self $profile) + public function addProfile(Twig_Profiler_Profile $profile) { $this->profiles[] = $profile; }