Add tests and make them pass

This commit is contained in:
brabli committed 2024-10-09 16:03:18 +01:00
1 parent e302da0fa6
commit d6f54eb17f
2 files changed
+19 -1

No files matched your search

+5 -1
View File
@@ -45,7 +45,11 @@ trait GeocodeTrait
public function isGeocoded(): bool
{
return null !== $this->getLatitude() && null !== $this->getLongitude() && (0.0 !== $this->getLatitude() && 0.0 !== $this->getLongitude());
$latIsntNull = null !== $this->getLatitude();
$longIsntNull = null !== $this->getLongitude();
$bothArentZero = !(0.0 === $this->getLatitude() && 0.0 === $this->getLongitude());
return $latIsntNull && $longIsntNull && $bothArentZero;
}
}