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
Add docblock properties #543
Conversation
@spaze Thanks for opening a PR! I don't think we should do this as the docblocks are here to surface the properties on the resource itself and not the possible parameters. Since there's no way to flag which one is a property and which one is a parameter, I think it would end up being confusing, even if you can set Let me know what you think! |
I agree with @remi-stripe here -- those two aren't request parameters, not resource properties. I don't think we even have a good way of documenting request parameters since in most cases the methods are simply inherited from the common traits. |
I understand your point of view and I'm not sure this would be the right way either. But I'm running a static analysis (using PHPStan) and it flags property access like As a compromise, I could add a comment like
which might help distinguish these from the others. |
Ah, that's a good point. I think that's a reasonable compromise. To be super clear, can you change it like this?
|
Of course! :-) Changed. |
I'm still wary of doing this change. We would have to go and do this for every single resource since most have something similar and then maintain it over time manually since none of this is automated today. This has been maintained mostly thanks to @nickdnk doing all that work. |
Thanks for the creds, @remi-stripe. I think this is a bad idea for a few reasons: One is that we have to do it everywhere to be consistent, as remi says, another is that this indicates to people who use the SDK that they can read All the current phpdocs match 1:1 to "The {object} object"-sections in the API. In this case the The customer object or The subscription object sections. Edit: @spaze Maybe you can silence the errors if you use |
I've created a simple extension for PHPStan that will emulate those undefined properties so they won't be flagged anymore. I'll add more properties to the extension once I'll find them. This can be closed then. Thanks everyone! |
@spaze Awesome, thanks for sharing that related project too! |
Hi everyone,
this adds two properties that are only used when updating objects:
Thanks!