taxamo / taxamo-php

Other
10 stars 7 forks source link

Use Namespaces or Class Prefixes #12

Closed jcoby closed 9 years ago

jcoby commented 9 years ago

The Taxamo PHP API library is basically unusable as it sits without using either namespaces or class prefixes. With class names like Report, Transaction, Transactions, APIClient, etc there is an extremely good chance of conflicts with existing classes in other projects. Transaction actually causes conflicts in our app.

Using either namespaces (Taxamo\Transaction or class prefixes Taxamo_Transaction) would make the API usable without having to maintain our own swagger-generated version of the API.

tlipski commented 9 years ago

Just pushed 2.0.0 to packagist with Taxamo namespace. See tests for updated usage.

Please note that to give it a try, you need to use:

{
  "require": {
    "taxamo/taxamo-php": "2.*"
  }
}

Please let me know if that helps.

jcoby commented 9 years ago

Thanks. Will test today.

Namespaces require php >=5.3. I did notice that composer.json did not get the require section updated in your changeset.

jcoby commented 9 years ago

Seems to work using the test framework. #13 needs to be applied before I can use in our codebase though (we use Composer to install and load the Taxamo API).

tlipski commented 9 years ago

Version 2.0.2 released with PHP requirement bumped up to 5.3