maxmind / GeoIP2-php

PHP API for GeoIP2 webservice client and database reader
https://maxmind.github.io/GeoIP2-php/
Apache License 2.0
2.33k stars 276 forks source link

Wrong doc comments #66

Closed kidol closed 8 years ago

kidol commented 8 years ago

This

return $record->city->name

might return null. Same with timeZone. Probably more.

Doc comment for city says:

@property string $name The name of the city based on the locales list passed to the constructor. This attribute is returned by all end points.

Should be changed to something like:

@property string|null $name The name of the city based on the locales list passed to the constructor (null in case the city is unknown). This attribute is returned by all end points.

Also I think it's better to remove all cases of This attribute is returned by all end points. Instead, better only make a note in case the attribute is not supported by all endpoints.