Closed AdrienPoupa closed 1 year ago
You cannot access the continent from the country. You would access it with $record->continent->code
. This is the same way you would access it if $record
was a GeoIp2\Model\Country
.
I am not sure how I missed that, sorry 😮💨 thanks a lot!
Reading the documentation here: https://maxmind.github.io/GeoIP2-php/doc/v2.13.0/classes/GeoIp2-Model-City.html
I would assume that I can access the
continent
property from theCity
model.However it is not present in the PHPDoc of the model, hence PHPStan and PHPStorm cannot see it:
Access to an undefined property GeoIp2\Record\Country::$continent.
This is kinda odd though because I can see that City extends Country, that has Continent defined. I think the IDE maps the
country
property of City to the record, not the model, so it cannot find the continent.