fabpot/Twig — Issue #640: Missing methods in Twig_TemplateInterface
Author: stof
Created: 2012-02-19 01:42:32+00:00
State: open

The code in Twig expects a template to implement Twig_TemplateInterface. However, many places in the code are calling public methods of the Twig_Template class which are not part of the interface. This code will be broken if someone uses a template that does not extend the original class as the code does not check that the object is indeed an instance of Twig_Template (there is one place in ``getParent`` where it is checked but passing another Twig_TemplateInterface`` object will then be a PHP error as it will be using the object as key in an array)

So either the template interface should be dropped as it is simply unusable currently, or the other methods should be added in it to ensure they are implemented, even if they should be reserved to the internal use of Twig