Used ShlinkTable on every location rendering a CLI table

This commit is contained in:
Alejandro Celaya
2018-12-08 12:12:11 +01:00
parent 46a35c553e
commit bb40d84212
7 changed files with 76 additions and 12 deletions

View File

@@ -11,6 +11,8 @@ use Shlinkio\Shlink\Common\Exception\WrongIpException;
use Shlinkio\Shlink\Common\Util\IpAddress;
use Shlinkio\Shlink\Core\Model\Visitor;
use Shlinkio\Shlink\Core\Repository\VisitRepository;
use Shlinkio\Shlink\Core\Visit\Model\UnknownVisitLocation;
use Shlinkio\Shlink\Core\Visit\Model\VisitLocationInterface;
/**
* Class Visit
@@ -88,9 +90,9 @@ class Visit extends AbstractEntity implements JsonSerializable
return ! empty($this->remoteAddr);
}
public function getVisitLocation(): VisitLocation
public function getVisitLocation(): VisitLocationInterface
{
return $this->visitLocation;
return $this->visitLocation ?? new UnknownVisitLocation();
}
public function locate(VisitLocation $visitLocation): self