-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
[2.x] modConnectorResponse — allow dynamic properties #16562
[2.x] modConnectorResponse — allow dynamic properties #16562
Conversation
What dynamic properties are being assigned to this class? It sounds like the source of the issue may need to be addressed rather than solving it with the AllowDynamicProperties attribute. |
The dynamic property is |
Thanks. That seems like an oversight. I'll dig in today or tomorrow and see if I can't resolve this by defining the expected properties. |
I believe all that needs to be done is to add |
I'm not sure that's the only property being dynamically assigned here. Also, these should likely be private properties, but I'll need to investigate. |
@opengeek Thank you Jason for looking into this 🙂 |
See #16563 for my proposed solution to this warning. If you agree with the solution, please close this PR, @marcuspoehls. |
#16563) ### What does it do? Assign the processor result to a local variable rather than dynamically creating a "response" property on the modConnectorResponse class. ### Why is it needed? In PHP 8.2, dynamically assigning a property to a class is deprecated. When calling runProcessor, the result is only used within the `outputContent()` method, so there is no need to assign the result from runProcessor to a property of modConnectorResponse dynamically or add a property to modConnectorResponse to hold the result. ### How to test Confirm no deprecated warnings are logged when running a processor in a connector. ### Related issue(s)/PR(s) Alternative solution to #16562
What does it do?
Added
#[\AllowDynamicProperties]
PHP attribute to themodConnectorResponse
.Why is it needed?
This change silences a deprecation warning in PHP 8.2 because of dynamic property assignments in this class. This also fixes issues with the package management, because the response now contains valid JSON instead of HTML.
Related issue(s)/PR(s)