You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user of Geocoder/Model/Address, I expect calls to getCountryCode() to return null or empty string, rather than an error. In particular, return $this->country->getCode();
might have country defined as null which is the constructor's default.
This is also a problem in toArray().
Further, there is no getCountryName(), so you should likely create that, else mark this method as @deprecated.
To recap, the legitimate code fragment $address = new Address(); var_export( $address->toArray() );
throws an error, rather than print out ['latitude' => null, 'adminlevels' => [], ...]
Activity
Nyholm commentedon Oct 12, 2016
Thank you for this issue. Have a look at the new
Positioninterface in #529. That relates to your issue. I even added a test for that.bingalls commentedon Oct 14, 2016
Hmm. I like what I'm reading in the discussion. I can review your code, when it arrives, if this is what you mean.
Nyholm commentedon Oct 14, 2016
You may review the code now if you like. See if it would solve your issue and give it a 👍 or 👎 .
bingalls commentedon Nov 7, 2016
Sorry, I could not find the code, outside of the discussion.
Nyholm commentedon Dec 22, 2016
The script:
Will produce:
Which is as you expect. This issue is solved by #529