Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function evaluate($value)
 {
     $geolocalizable = $this->selector->apply($value);
     if (!$geolocalizable instanceof GeolocalizableInterface) {
         throw new \LogicException(\sprintf('%s not implement %s, the near operator is defined only to %s instances', \is_object($geolocalizable) ? \gettype($geolocalizable) : \get_class($geolocalizable), GeolocalizableInterface::class, GeolocalizableInterface::class));
     }
     return $geolocalizable->coordinate() !== null && $geolocalizable->coordinate()->distance($this->coordinate())->compareTo($this->radius()) <= 0;
 }