-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Non-existing method call #20435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are you using the dev version of Twig 2.x ? This could be the issue. Twig 2.x is a fast moving target these days, with lots of APIs being deprecated in 1.x and removed in the dev version of 2.x (Fabien dedicated time to Twig to move towards a 2.0 release). Symfony code may not be fully updated yet for all these changes (especially if you use a stable release of Symfony rather than the dev version as well). |
I'm using Symfony dev version |
@ShinDarth can you please show the output of this command? Thanks!
|
@javiereguiluz sure:
|
@ShinDarth Can you please check if #20440 solves the issue for you? |
@xabbuh at the moment I can't, I can check tomorrow. Anyway thanks for that PR, I left a comment btw. |
…xt() over getSource() (xabbuh) This PR was merged into the 2.7 branch. Discussion ---------- [TwigBridge][TwigBundle][HttpKernel] prefer getSourceContext() over getSource() | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20435 | License | MIT | Doc PR | n/a Commits ------- adbc529 prefer getSourceContext() over getSource()
@xabbuh I've just tested and it works, thanks again. |
@ShinDarth Thank you for reporting the issue initially and for providing quick feedback! |
In: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php#L137
there is this line:
$loader->getSource($template);
both my IDE and phpunit complain that the method
getSource()
does not exist, which is causing me troubles when writing unit tests.Also I don't understand the purpose of that call, it is a
get
method so it is supposed to return something, but we are never using the returned value.I guess lines 136-141 can just be removed, in that case I can open a PR.
The text was updated successfully, but these errors were encountered: