BanEntry: remove nullable return from parseDate()

this function never returns null
This commit is contained in:
Dylan K. Taylor 2019-12-12 11:59:41 +00:00
parent b8778cb791
commit a9fafbc5eb

View File

@ -136,10 +136,10 @@ class BanEntry{
/** /**
* @param string $date * @param string $date
* *
* @return \DateTime|null * @return \DateTime
* @throws \RuntimeException * @throws \RuntimeException
*/ */
private static function parseDate(string $date) : ?\DateTime{ private static function parseDate(string $date) : \DateTime{
$datetime = \DateTime::createFromFormat(self::$format, $date); $datetime = \DateTime::createFromFormat(self::$format, $date);
if(!($datetime instanceof \DateTime)){ if(!($datetime instanceof \DateTime)){
throw new \RuntimeException("Error parsing date for BanEntry: " . implode(", ", \DateTime::getLastErrors()["errors"])); throw new \RuntimeException("Error parsing date for BanEntry: " . implode(", ", \DateTime::getLastErrors()["errors"]));