avadev / AvaTax-Calc-REST-PHP

PHP sample for the AvaTax Calc REST API
Apache License 2.0
9 stars 28 forks source link

Made repo psr-0 compliant for Composer #10

Closed shrimpwagon closed 10 years ago

shrimpwagon commented 10 years ago

The integration for Composer wasn't done quite right. I removed AvaTax.php from classes and made the functions there public static. Creating a raw function in global space for libraries may cause name conflicts. Also the autoload register is not needed since Composer takes care of this. I put all the classes in an 'AvaTax' namespace as per psr-0 specs. Had to remove the 'class' word from filenames for Composer to properly autoload the classes. Also updated composer.json accordingly. So to utilize the classes you would need to prepend them with AvaTax. Sorry, I did not update your examples.

anyarms commented 10 years ago

I went around and around on that Composer autoload thing, but I'm not familiar enough with the space (well, and PHP) to catch that! Thanks for the update! I'm more than happy to update the samples myself :)

shrimpwagon commented 10 years ago

Yah, no problem. Composer isn't the easiest to deal with at first. My commits are very solid as far as a Composer solution. You can trust it. I already have it working in a dev environment.

shrimpwagon commented 10 years ago

Are you going to merge this in?

anyarms commented 10 years ago

Finally, yes!