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
I have a mysql table containing a point (for coordinates) column. In the corresponding model I cast this column to the Matan\Yadaev\EloquentSpatial\Objects\Point class from https://github.com/MatanYadaev/laravel-eloquent-spatial.
The Point class is a subclass of Geometry. But only the Point class has public latitude and longitude properties, which my IDE now doesn't know about.
Is it possible in some way to enforce that the $location property is type hinted as Point i/o Geometry? I tried editing the ide_helper config file, adding:
So I did some further research myself and I found the cause, and also a workaround. The cause is not a bug in my opinion but just a result of how things work in ide-worker and how things are implemented in the EloquentSpatial lib.
and now it works, for my limited case. This is a hack because it only works as long as I don't use any of the other Geometry subclasses (like fe Polygon) as eloquent cast, because all other subclasses will be resolved to Point which would be even more wrong.
I wouldn't know a better solution and I even doubt whether this is solvable at all for all cases.
Versions:
Question:
I have a mysql table containing a point (for coordinates) column. In the corresponding model I cast this column to the
Matan\Yadaev\EloquentSpatial\Objects\Point
class from https://github.com/MatanYadaev/laravel-eloquent-spatial.When I generate the docblocks using ide-helper, the property gets type hinted as follows:
I would expect:
The Point class is a subclass of Geometry. But only the Point class has public
latitude
andlongitude
properties, which my IDE now doesn't know about.Is it possible in some way to enforce that the $location property is type hinted as Point i/o Geometry? I tried editing the ide_helper config file, adding:
but that doesn't seem to work. Also tried the other way around.
The text was updated successfully, but these errors were encountered: