-
Notifications
You must be signed in to change notification settings - Fork 95
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
How to specify a method signature for a function that returns void? #117
Comments
That's a good question. I am dumbfounded never to have thought about it - or maybe I just forgot... :-D The long-read version is:
So it seems that we are stuck between a rock and a hard place. There is no support for void returns in xml-rpc, and trying to shoehorn NULL as the closest thing to VOID might be unreliable. You might of course extend phpxmlrpc to make it better support void returns, but then any automation around validation of parameters would become essentially valid only when you control both sides of the communication, ie. bye bye interoperability. On a more practical note: I just looked at the source code of phpxmlrpc, the If you are creating by hand the data structure for the method signature, you should thus probably use "undefined"... |
ps: looking at the manual, I think that the solution I outlined above, i.e. using the string See: https://github.com/gggeek/phpxmlrpc/blob/master/doc/manual/phpxmlrpc_manual.adoc#signatures Of course, saying "this method will return anything" is not the same thing as saying "this method will return nothing", so I agree that this is more of a workaround/hack than anything else. But atm I can think of no better solution, for the reasons detailed above. |
Thanks for the detailed explanation. I'll use Value::$xmlrpcValue: that's good enough for me. |
Ok. |
I don't see void mentioned in the docs or in \PhpXmlRpc\Value class. What is the recommended wat to specify (no) result type void in the method signature?
The text was updated successfully, but these errors were encountered: