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

Enhancement: Enable IntelliSense (IDE friendly) for class properties #277

Closed
phpdave opened this issue Sep 26, 2016 · 7 comments · Fixed by #375
Closed

Enhancement: Enable IntelliSense (IDE friendly) for class properties #277

phpdave opened this issue Sep 26, 2016 · 7 comments · Fixed by #375
Assignees
Labels
V2 V2 Client

Comments

@phpdave
Copy link

phpdave commented Sep 26, 2016

It would be nice if the class properties where accessible to intellisense. For example the Recurly_Transaction has a field called payment_method but the only way to know this is to look at the documentation online or the xml data in Tests/fixtures/invoices||transacitons. This is because of the use of __get. I'd like to recommend that you add PHPDoc property tags to make it easier for developers to use the classes. https://phpdoc.org/docs/latest/references/phpdoc/tags/property.html

Example of the change (you would add all the properties):

<?php

 /**
  * @property string $payment_method credit_card, paypal, check, wire_transfer, money_order.
  */
class Recurly_Transaction extends Recurly_Resource

This is what intellisense would show

intellisense

This is what intellisense currently shows

current

There's no suggestions on what properties are in the class.

@phpdave phpdave changed the title Enhancement: Enable IntelliSense (IDE friendly) Enhancement: Enable IntelliSense (IDE friendly) for class properties Sep 26, 2016
@drewish
Copy link

drewish commented Sep 26, 2016

Yeah that does seem helpful. If you have time to start a PR I'd be happy to review it.

@phpdave
Copy link
Author

phpdave commented Sep 27, 2016

Started working on a poor man's screen scraper to pull the field names, data type and descriptions from the Recurly docs using js and jquery and output it into the PHP Doc format.

https://gist.github.com/phpdave/0804dec42e88a9ae192db73eaba7ff27

only problem appears to be that i might have to use the xml data for some classes as not all the fields appear to be in the documentation. I'll take another look tomorrow

@phpdave
Copy link
Author

phpdave commented Sep 27, 2016

@drewish I've created the pull request here: #278

@bhelx
Copy link
Contributor

bhelx commented Jan 19, 2017

@phpdave @drewish should this issue still be open?

@phpdave
Copy link
Author

phpdave commented Jan 19, 2017

The invoice and subscription properties for intellisense were never added because I didn't get them in before the merge. We did get account, adjustment, billing_info,plan, transaction done with the merge. I'll leave it up to you guys if you want to get these properties added for intellisense to work. I just don't have the time right now to do any modifications if the files have changed since Sept 27.

https://github.com/phpdave/recurly-client-php/blob/master/lib/recurly/invoice.php
https://github.com/phpdave/recurly-client-php/blob/master/lib/recurly/subscription.php

@bhelx
Copy link
Contributor

bhelx commented Jan 19, 2017

@phpdave Thanks for the update. We'll leave it open for now. Also thanks again for contributing back those changes!

@drewish
Copy link

drewish commented Jan 20, 2017

Oh yeah I'd totally spaced this one out. Let's give it a dust off and get it in there. Apologies for the delay.

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

Successfully merging a pull request may close this issue.

4 participants