Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

audoh
Copy link

@audoh audoh commented Feb 15, 2017

… 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.

… 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());

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().

@audoh
Copy link
Author

audoh commented Feb 21, 2017

@soullivaneuh thanks, change made, tested & committed.

@davividal
Copy link

Any update on this?

@LukeTowers
Copy link

Please resubmit to the 2.0 branch of assetic-php/assetic.

@davividal
Copy link

@LukeTowers done: #898 .

@davividal
Copy link

Sorry! Misunderstood what you said @LukeTowers . I think I finally got it right: assetic-php/assetic#2

@LukeTowers
Copy link

@davividal perfect, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants