@@ -1355,15 +1355,15 @@ public function deleteDocument(string $collection, string $id): bool
13551355 /**
13561356 * Handle distance spatial queries
13571357 *
1358- * @param string $spatialAttributeType
13591358 * @param Query $query
13601359 * @param array<string, mixed> $binds
13611360 * @param string $attribute
1361+ * @param string $type
13621362 * @param string $alias
13631363 * @param string $placeholder
13641364 * @return string
13651365 */
1366- protected function handleDistanceSpatialQueries (string $ spatialAttributeType , Query $ query , array &$ binds , string $ attribute , string $ alias , string $ placeholder ): string
1366+ protected function handleDistanceSpatialQueries (Query $ query , array &$ binds , string $ attribute, string $ type , string $ alias , string $ placeholder ): string
13671367 {
13681368 $ distanceParams = $ query ->getValues ()[0 ];
13691369 $ wkt = $ this ->convertArrayToWKT ($ distanceParams [0 ]);
@@ -1391,7 +1391,7 @@ protected function handleDistanceSpatialQueries(string $spatialAttributeType, Qu
13911391
13921392 if ($ useMeters ) {
13931393 $ wktType = $ this ->getSpatialTypeFromWKT ($ wkt );
1394- $ attrType = strtolower ($ spatialAttributeType );
1394+ $ attrType = strtolower ($ type );
13951395 if ($ wktType != Database::VAR_POINT || $ attrType != Database::VAR_POINT ) {
13961396 throw new DatabaseException ('Distance in meters is not supported between ' .$ attrType . ' and ' . $ wktType );
13971397 }
@@ -1426,7 +1426,7 @@ protected function handleSpatialQueries(string $type, Query $query, array &$bind
14261426 case Query::TYPE_DISTANCE_NOT_EQUAL :
14271427 case Query::TYPE_DISTANCE_GREATER_THAN :
14281428 case Query::TYPE_DISTANCE_LESS_THAN :
1429- return $ this ->handleDistanceSpatialQueries ($ type , $ query , $ binds , $ attribute , $ alias , $ placeholder );
1429+ return $ this ->handleDistanceSpatialQueries ($ query , $ binds , $ attribute, $ type , $ alias , $ placeholder );
14301430
14311431 case Query::TYPE_INTERSECTS :
14321432 $ binds [": {$ placeholder }_0 " ] = $ this ->convertArrayToWKT ($ query ->getValues ()[0 ]);
0 commit comments