-
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
Deprecated loadFromArray for loadFromStdClass and fixed parsing of contacts in Groups::getContacts #182
Conversation
Hi @MelvinLoos thank you for the PR this looks neat. There are some small things that I would like to go over before merging this. (eg contacts being an stdClass but they're still initialized as array. |
Ah yes well spotted! If I can find the time I will modify the contacts property tonight. Anything else that I missed? |
One small thing extra :) |
Also one more inconsistency which I wanted to point out and I think we should fix/correct. Since it caused a bit of confusing for me when I started working with this library and also when working on it again today. The fact that the models/objects use a method called |
@MelvinLoos I agree, it makes sense. Let's just not rename it, but keep the current one, mark it as deprecated, and we can remove it in a future major version (3.0 isn't released, but I'd still want to have an easier upgrade path). |
Took me awhile to find the time for this, sorry about that. I have renamed this issue to better reflect the changes. The initial fix revealed alot of inconsistencies in the implementation of the response parsing. As requested I have deprecated the loadFromArray methods (instead of deleting them) so it should all be backwards-compatible. All internal methods have been refactor to use the new loadFromStdClass method but the public API should still be intact. Please check if I missed anything. (I have ran phpunit this time so if everything is tested it should be good) @CoolGoose is the PR like this ok or would you like me to split the deprecation and the bug fix into two separate pull requests? |
@MelvinLoos I apologise for the late reply. Can you please check psalm ? If not I'll try to make time next week to do it, thank you for the updates they're nice to cleanup the codebase. |
Will try to make time for it this weekend or else I will reserve some time in my work schedule on monday |
@CoolGoose ok I have corrected the code based on the php 7.3 phpunit tests. I had to downgrade some code to make it php 7.3 compatible but nothing major and I implemented docblocks annotations to compensate. |
Thank you @MelvinLoos for the patience. Will be in the 3.0 release this week. |
Unfortunately that's not the case - |
Yes you seem to be right. I somehow missed that instance.... |
I fixed the Group::loadFromArray method and added return type to other objects.