BanEntry: clean up getString()

This commit is contained in:
Dylan K. Taylor 2022-01-28 21:53:28 +00:00
parent 0642364a44
commit 15425d01bc
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -107,18 +107,13 @@ class BanEntry{
}
public function getString() : string{
$str = "";
$str .= $this->getName();
$str .= "|";
$str .= $this->getCreated()->format(self::$format);
$str .= "|";
$str .= $this->getSource();
$str .= "|";
$str .= $this->getExpires() === null ? "Forever" : $this->getExpires()->format(self::$format);
$str .= "|";
$str .= $this->getReason();
return $str;
return implode("|", [
$this->getName(),
$this->getCreated()->format(self::$format),
$this->getSource(),
$this->getExpires() === null ? "Forever" : $this->getExpires()->format(self::$format),
$this->getReason()
]);
}
/**