-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Notice: Only variable references should be returned by reference #39089
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
Can you share some stack trace about where this code happens ? |
@stof addressed, I also added the service definition for that service. |
@nicolas-grekas could this be a bug in the proxy generated by |
It could, or it could be an issue with the monkey-patching logic we have in the bridge, we should first check that. @greg0ire can you share the content of the |
Here you go: https://hastebin.net/wuzirolega.php |
What's your exact version of proxy-manager? |
OK, that's an issue with proxy-manager: We'll have to fix this in the bridge also with some monkey-patching for 4.4 (since proxy-manager is not maintained for PHP version 7.1.) |
Thanks for finding the root cause, I reported this upstream |
…hp/proxy-manager-lts" (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts" | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39089 | License | MIT | Doc PR | - I submitted the fix for #39089 on the origin library at Ocramius/ProxyManager#646. Because of the [versioning policy](https://github.com/Ocramius/.github/blob/6d4561515513f6d59fb144d838971d4a7715e3e4/version-support.md#dependency-upgrades) in use at the origin library, this fix won't be available for PHP < 7.4. We usually resort to monkey-patching to workaround the policy and still ship the fix for 4.4 (which supports PHP >= 7.1). This time, and as explained in Ocramius/ProxyManager#630, I propose to delegate the fix to [friendsofphp/proxy-manager-lts](https://github.com/FriendsOfPHP/proxy-manager-lts/). It already embeds the fix and a few others that allow us to remove most of the monkey-patching we had to accumulate over time. Commits ------- 389f530 [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
Symfony version(s) affected: 5.1.8
Description
I'm getting the notice in the title. The code that causes it looks like this:
How to reproduce
I don't know how to reproduce the generation of this piece of code yet, but reproducing the notice is easy enough:
https://3v4l.org/dE26T
I suspect it is related to this service definition (which looks quite simple):
Possible solution
Do it in 2 steps: https://3v4l.org/j501X ?
Stack trace:
The text was updated successfully, but these errors were encountered: