Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

[TRANSFERS] Calling setHolder before setTransfers causes a warning. #184

Closed
joaolucasl opened this issue Oct 2, 2017 · 0 comments
Closed

Comments

@joaolucasl
Copy link
Contributor

In setHolder there's a reference to transferInstrument, which is instantiated in setTransfers.

https://github.com/moip/moip-sdk-php/blob/8b13518d19cc4f8ab8285357f05c4d6d0d57da07/src/Resource/Transfers.php#L93-L100

If this method is called before setTransfers, it will trigger a warning.


How to fix?

Both setHolder and setTransfers need to check for the existence of $this->data->transferInstrument - if it doesn't exist, it is instantiated. (Otherwise, it would override the existing data)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant