Closed rcerljenko closed 6 months ago
As discussed in #172 we should start with request payload objects and static analysis instead of data resolvers in a forward compatible way and then deprecate the old apis :)
How do we validate payload objects? Via phpdoc ?
Yes, with SA tools, so no overhead on runtime perf :)
Ok I'll try
Instead of direct arrays add an payload object so users instantiate it and get autocomplete for available methods :)
@norkunas check it out now if that's it
aha I see... you mean with some sort of DTO?
Yes ;)
@norkunas how about now? i'll just fix the fixer erros if that's ok
Will continue tomorrow, going afk, thanks :)
Looks good, now the tests should be added :)
Looks good, now the tests should be added :)
ah yes, we love writing tests yes
I think we should introduce new method as a replacement for sendRequest
as throwing in previous apis will be a BC break.
Maybe makeRequest
:thinking:
I think we should introduce new method as a replacement for
sendRequest
as throwing in previous apis will be a BC break. MaybemakeRequest
🤔
this is going to be ugly since I can't reuse sendRequest() i would need to copy entire method in order to get both the Request and Response object instances
I think we should introduce new method as a replacement for
sendRequest
as throwing in previous apis will be a BC break. MaybemakeRequest
🤔this is going to be ugly since I can't reuse sendRequest() i would need to copy entire method in order to get both the Request and Response object instances
yeah, but better than adding a bool flag to toggle throwing and deprecating extending OneSignal::sendRequest
method without that argument which would be later just dropped..
I think we should introduce new method as a replacement for
sendRequest
as throwing in previous apis will be a BC break. MaybemakeRequest
🤔this is going to be ugly since I can't reuse sendRequest() i would need to copy entire method in order to get both the Request and Response object instances
yeah, but better than adding a bool flag to toggle throwing and deprecating extending
OneSignal::sendRequest
method without that argument which would be later just dropped..
done :)
good :muscle: now tests, after this PR will try to spend time on this also :)
Could you squash all commits? :)
Can't you do that on merge?
Also, I still have to write test for "Create segment" method.
Thank you :) now will need to add remaining apis and deprecate old ones for a new release
Thank you :) now will need to add remaining apis and deprecate old ones for a new release
Yes. Bit by bit... :) But at least we now have a "modus operandi"
true :)
will you trigger a new release soon?
Wont do partial releases for now
If you need you can always use dev branch in composer json :)
Hi,
In addition to my previous work, this one adds a new "Segments" API calls for Create, List and Delete actions.