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

1.3.1 cannot find Shippo_Address #45

Open
Nacoma opened this issue May 1, 2017 · 5 comments · May be fixed by #49
Open

1.3.1 cannot find Shippo_Address #45

Nacoma opened this issue May 1, 2017 · 5 comments · May be fixed by #49

Comments

@Nacoma
Copy link
Contributor

Nacoma commented May 1, 2017

Calling \Shippo\Shippo_Address::create($params); throws:

FatalThrowableError (E_ERROR)
Class 'Shippo_Address' not found

in Object.php.

The problem is that $class should contain the fully qualified namespace as explained here.

@mootrichard
Copy link
Contributor

So, with the way that the wrapper is setup, Shippo_Address isn't a method of the class Shippo. Shippo is an abstract class that is just used for setting and retrieving the API key, API version, and a few other API specific details.

So the way of calling that method from the Shippo namespace for the Shippo_Address class should be formed as Shippo\Shippo_Address::create($param);

This should look into the Shippo namespace for a class named Shippo_Address for the create() method.

I hope that clears things up, but if I am missing something here, please let me know.

@Nacoma
Copy link
Contributor Author

Nacoma commented May 2, 2017

I'm not sure what you're getting at in your first paragraph. The problem is that the Object class needs to use the fully qualified domain name when trying to create a new instance.

It is trying to instantiate \Shippi_Address and should be instantiating \Shippo\Shippo_Address.

@mootrichard
Copy link
Contributor

So, admittedly I am not as well versed in PHP, but the issue appears to be a result of how namespacing was done here (along the lines of what you mentioned with missing fully qualified namespaces).

We rolled back the changes and as of #48 should be resolved.

@Nacoma
Copy link
Contributor Author

Nacoma commented May 5, 2017

Do you guys accept PRs?

@mootrichard
Copy link
Contributor

We most certainly do! If you want to contribute, feel free to fork the repo and create some proposed changes and submit them as a PR. We'll review it and provide feedback, and should the changes look good, we'll merging them into the repo.

@Nacoma Nacoma linked a pull request May 5, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants