Skip to content
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

Resource Objects #301

Open
JakeBooher opened this issue Apr 16, 2020 · 1 comment
Open

Resource Objects #301

JakeBooher opened this issue Apr 16, 2020 · 1 comment

Comments

@JakeBooher
Copy link

Would be incredibly useful if there were Resource object classes that were returned rather than just a generic PHP object, if done correctly this would be fully backwards compatible as well. Could allow type hinting and such for IDE auto completion.

I'd be happy to contribute towards this via a PR if this is something that would be accepted

@GabrielAnca
Copy link
Contributor

Hi @JakeBooher, sorry for the delay I totally missed your message. I have been thinking about what you mentioned for a long time. I think it would be great to have something like what you mention.

We originally went for stdClasses so that all the new fields we add get immediately added to the objects. The main idea was to avoid creating friction if we need to release a new SDK version every time we add a new property to a resource.

If you have time for that, I'd love to see what you have in mind. If you want to contribute, I'd recommend opening an initial PR with just one single model, so we can get an agreement on how we want them to look like, and then we can work towards creating resource objects for the rest of the models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants