Changes:
+ * fixed usage of operators as method names (like is, in, and not)
* changed the order of execution for node visitors
* fixed default() filter behavior when used with strict_variables set to on
* fixed filesystem loader compatibility with PHAR files
$type = Twig_Node_Expression_GetAttr::TYPE_ANY;
if ($token->getValue() == '.') {
$token = $this->parser->getStream()->next();
- if ($token->getType() == Twig_Token::NAME_TYPE || $token->getType() == Twig_Token::NUMBER_TYPE) {
+ if ($token->getType() == Twig_Token::NAME_TYPE || $token->getType() == Twig_Token::NUMBER_TYPE || $token->getType() == Twig_Token::OPERATOR_TYPE) {
$arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
if ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
{{ items.foo.bar('a', 43) }}
{{ items.foo.bar(foo) }}
{{ items.foo.self.foo() }}
+{{ items.foo.is }}
+{{ items.foo.in }}
+{{ items.foo.not }}
--DATA--
return array('foo' => 'bar', 'items' => array('foo' => new Foo(), 'bar' => 'foo'))
--EXPECT--
bar_a-43
bar_bar
foo
+is
+in
+not
{
return $this;
}
+
+ public function is()
+ {
+ return 'is';
+ }
+
+ public function in()
+ {
+ return 'in';
+ }
+
+ public function not()
+ {
+ return 'not';
+ }
}
class TestExtension extends Twig_Extension