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

Use a standard for class names and paths #96

Closed
deviantintegral opened this issue Jul 9, 2014 · 4 comments
Closed

Use a standard for class names and paths #96

deviantintegral opened this issue Jul 9, 2014 · 4 comments
Labels

Comments

@deviantintegral
Copy link

At first glance, the Recurly PHP client appears to follow the PEAR standards for class names. However, it's only partially compliant:

  • errors.php contains multiple classes.
  • CamelCase'd classes like Recurly_InvoiceList should be in InvoiceList.php, not invoice_list.php.
  • Case mismatches break basic attempts at class loading (Recurly_Account should be in Account.php).

For autoloading on projects that aren't using Composer to pull in the library, we have to fall back to a custom loader with the paths hardcoded.

I see two possibilities:

  • Fix the existing codebase to comply with PEAR standards. It's old, but at least it's well supported and understood.
  • Namespace the module, and refactor all classes to be PSR-0 or PSR-4 compliant.
@drewish
Copy link

drewish commented Jul 9, 2014

Splitting out errors into separate files sounds fine.

I'm open to renaming files since our docs suggest require_once('lib/recurly.php'); and that should handling loading the other files.

I'd love to add namespacing but I don't see an easy way to add it and not break backwards compatibility with existing installations.

@vishalmelmatti
Copy link

  • Recurly client should follow psr-4 standard.

@drewish
Copy link

drewish commented Feb 18, 2016

@vishalmelmatti it would be great, but as noted would not be backwards compatible.

@aaron-junot
Copy link

As mentioned in #215 (comment), for backwards compatibility purposes, we're going to wait until version 3.x.x of the library to ensure compliance with a standard such as PSR.

@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants