doctrine / mongodb

PHP MongoDB Abstraction Layer

Home Page:https://www.doctrine-project.org/projects/mongodb.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught InvalidArgumentException

rimvislt opened this issue · comments

jmikola/geojson should be inside require because it is used inside doctrine/mongodb/lib/Doctrine/MongoDB/Aggregation/Stage/Match.php

and causes errors
PHP Fatal error: Uncaught InvalidArgumentException: Could not get class storage for geojson\geometry\geometry

while running php vendor/bin/psalm

As per the suggest section in composer.json, jmikola/geojson is an optional dependency you can import if you want to use GeoJSON objects:

Support GeoJSON geometry objects in 2dsphere queries

The classes are only used in use statements which don't cause missing class errors, similar to instanceof checks. Thus, this is not an error with this library but rather a misconfiguration.

As for the InvalidArgumentException, I suppose the exception originates within Psalm, but a look at the trace would easily confirm or refute this.

Closing as per discussion in Slack: this is not an error in this library but more likely in Psalm, potentially related to caches.