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

Docblocks for expanded properties #750

Closed
JasonTheAdams opened this issue Sep 26, 2019 · 2 comments · Fixed by #860
Closed

Docblocks for expanded properties #750

JasonTheAdams opened this issue Sep 26, 2019 · 2 comments · Fixed by #860
Labels

Comments

@JasonTheAdams
Copy link

It would be very handy, when working in an IDE such as PhpStorm, if the docblocks for object properties reflected their simple and expanded state.

Take the Subscription class, for example, and specifically the Subscription.latest_invoice property whose property is documented here: https://github.com/stripe/stripe-php/blob/master/lib/Subscription.php#L28

It would be great if that was instead:

/**
 * @property string|Invoice $latest_invoice
 */

This would inform the IDE that it may either be a string or an Invoice object.

I understand docblocks are slated for some point in the future. I'm making this purely to be helpful and to track this specific need for that time. 😄

@ob-stripe
Copy link
Contributor

👍 We should absolutely do this :)

@ob-stripe
Copy link
Contributor

This should be fixed in 7.23.0. All expandable fields should now be properly annotated as string|\Stripe\Resource.

Thanks for your patience! Please let us know if you notice anything amiss.

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

Successfully merging a pull request may close this issue.

2 participants