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

Missing Property Declarations give "Field accessed via magic method" warnings #358

Closed
JeminiRiver opened this issue Jul 23, 2018 · 4 comments · Fixed by #375
Closed

Missing Property Declarations give "Field accessed via magic method" warnings #358

JeminiRiver opened this issue Jul 23, 2018 · 4 comments · Fixed by #375
Assignees
Labels

Comments

@JeminiRiver
Copy link

Specifically, Recurly_Subscription is missing property declarations for the following (there may be others but these are the two that I use frequently and my IDE throws the warning)

@property string $uuid
@property string $current_period_ends_at

Both are included in the API documentation as properties of the response object and I've used both fields in code.
https://dev.recurly.com/docs/lookup-subscription-details

uuid - Unique subscription ID
current_period_ends_at - Date the current bill cycle will end

@JeminiRiver JeminiRiver changed the title Missing Property Declarations give "Field accessed via magic method warnings" Missing Property Declarations give "Field accessed via magic method" warnings Jul 23, 2018
@aaron-junot aaron-junot self-assigned this Jul 24, 2018
@aaron-junot
Copy link

Hi @JDubDev! I'm looking into your issue. I can confirm that there is no $uuid property declaration, but in the latest version of that file, there is a $current_period_ends_at on Line 37.

I noticed that it's a DateTime rather than a string. Is this why your IDE is throwing the warning for that?

It would help me confirm and fix your issue if you let me know which version of the Recurly library you're using as well as what IDE you're seeing the error(s) in so I can try to recreate the issue.

Thanks!

@JeminiRiver
Copy link
Author

JeminiRiver commented Jul 24, 2018

I'm using composer to manage and have it set to

"recurly/recurly-client":
"2.*",
The current version outputted by "composer show -i" is
recurly/recurly-client 2.10.3 The PHP client library for the Recurly API

And go figure, I ran an update earlier today and missed that the warning on current_period_ends_at dropped off. So that one is good to go. The UUID missing is the only one I'm still getting. My IDE, by the way, is PHPStorm by Jetbrains. Latest release version.

I did a quick check through my project for any Magic method warnings and found one other. It looks like in addition to the uuid missing from \Recurly_Subscription, plan is also missing. My first thought was that that should be a reference to \Recurly_Plan but the two aren't the same. It looks like maybe a stub object is needed for \Recurly_Subscription->plan that contains just plan_code and name. I did notice that, at least in this latest version, the \Recurly_Plan object has duplicate plan_code and name property declarations.

I'd be happy to clean these up on a fork and then submit a pull request if that's preferred.

@aaron-junot
Copy link

Sure, that would be great! I'll review your PR and merge it in as long as there are no issues. Thanks 🙂

@aaron-junot
Copy link

I just realized that this relates to #277. I'm going to try to get to that in the next couple weeks, and when I open that PR, ideally it will fix this as well. It will be nice to close out two issues with one PR.

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.

3 participants