/** * @throws \InvalidArgumentException * * @param Coordinate $latitude * @param Coordinate $longitude */ private function assertConstraintsNotViolated(Coordinate $latitude, Coordinate $longitude) { abs($latitude->asDecimal()) <= self::LATITUDE_MAX_VAL || $this->throwException(sprintf('Latitude should be equal or greater than %f and equal or less than %f.', -self::LATITUDE_MAX_VAL, self::LATITUDE_MAX_VAL)); abs($longitude->asDecimal()) <= self::LONGITUDE_MAX_VAL || $this->throwException(sprintf('Longitude should be equal or greater than %f and equal or less than %f.', -self::LONGITUDE_MAX_VAL, self::LONGITUDE_MAX_VAL)); }