-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Removed old Twig_TokenStream::getFilename call in AsseticTokenParser,… #845
base: master
Are you sure you want to change the base?
Conversation
… which occurred when an unexpected punctuation exception was thrown.
@@ -113,7 +113,7 @@ public function parse(\Twig_Token $token) | |||
$attributes[$key] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); | |||
} else { | |||
$token = $stream->getCurrent(); | |||
throw new \Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', \Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $stream->getFilename()); | |||
throw new \Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', \Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $stream->getSourceContext()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be $stream->getSourceContext()->getName()
.
@soullivaneuh thanks, change made, tested & committed. |
Any update on this? |
Please resubmit to the 2.0 branch of assetic-php/assetic. |
@LukeTowers done: #898 . |
Sorry! Misunderstood what you said @LukeTowers . I think I finally got it right: assetic-php/assetic#2 |
@davividal perfect, thanks! |
… which occurred when an unexpected punctuation exception was thrown (throwing its own exception as a result). It was replaced with Twig_TokenStream::getSourceContext.
If you're using Twig 2 and you use 'unexpected punctuation', you'll get an exception about the call.