You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm planning to add more improvements on the returned resources over the coming versions.
If you have an idea on how we can improve the returned typing without adding a dedicated method on the request itself, please let me know!
I'm not sure if there are any ongoing efforts on this account, but wanted to create this issue mostly as an encouraging nod that such attempts would be greatly appreciated and as a way to track possible updates.
As for ideas, there's two roads forward I can see that come to my mind:
leverage distinct methods, similar to how the 'old' interfaces worked, however this is seemingly (per V3 typing #789 (comment) again) not the intended way to go
introduce a generic type TResponse to the ResourceHydratableRequest; in theory (I've not really attempted much of this), I think something along the lines of the following signature on send could then be used:
In the v3 major release strongly typed request objects were introduced; see also https://github.com/mollie/mollie-api-php/blob/master/UPGRADING.md#typed-request-objects. Where these are a great addition for writing safer code, they unfortunately result in less strict inferred types when doing static analysis, as the return type of
sendis simplymixed:mollie-api-php/src/Traits/SendsRequests.php
Lines 40 to 43 in 6feb9bb
In #789 (comment) I read:
I'm not sure if there are any ongoing efforts on this account, but wanted to create this issue mostly as an encouraging nod that such attempts would be greatly appreciated and as a way to track possible updates.
As for ideas, there's two roads forward I can see that come to my mind:
TResponseto theResourceHydratableRequest; in theory (I've not really attempted much of this), I think something along the lines of the following signature onsendcould then be used: