lib/Elastica/Query/GeoBoundingBox.php
public function addCoordinates(string $key, array $coordinates): self
    {
        if (!isset($coordinates[0]) || !isset($coordinates[1])) {
            throw new InvalidException('expected $coordinates to be an array with two elements');
        }

        $this->setParam($key, [
            'top_left' => $coordinates[0],
            'bottom_right' => $coordinates[1],
        ]);

        return $this;
    }
public function addCoordinates(string $key, array $coordinates): self
    {
        if (!isset($coordinates[0]) || !isset($coordinates[1])) {
            throw new InvalidException('expected $coordinates to be an array with two elements');
        }

        $this->setParam($key, [
            'top_left' => $coordinates[0],
            'bottom_right' => $coordinates[1],
        ]);

        return $this;
    }
public function addCoordinates ( string $ key , array $ coordinates ) : self { if ( ! isset ( $ coordinates [ 0 ] ) || ! isset ( $ coordinates [ 1 ] ) ) { throw new InvalidException ( 'expected $coordinates to be an array with two elements' ) ; } $ this -> setParam ( $ key , [ 'top_left' => $ coordinates [ 0 ] , 'bottom_right' => $ coordinates [ 1 ] , ] ) ; return $ this ; }
Add coordinates.

@param string $key         Key
@param array  $coordinates Array with top left coordinate as first and bottom right coordinate as second element

@throws \Elastica\Exception\InvalidException If $coordinates doesn't have two elements

@return $this
Add coordinates .