public function nearSphere($x, $y = null)
{
if ($x instanceof Point) {
$x = $x->jsonSerialize();
}
if (is_array($x)) {
return $this->operator('$nearSphere', ['$geometry' => $x]);
}
return $this->operator('$nearSphere', [$x, $y]);
}
public function testMaxDistanceWithNearSphereAndLegacyCoordinates() { $expr = new Expr(); $expr->nearSphere(1, 2); $this->assertSame($expr, $expr->maxDistance(1)); $this->assertEquals(array('$nearSphere' => array(1, 2), '$maxDistance' => 1), $expr->getQuery()); }