BanEntry: remove useless do/while

This commit is contained in:
Dylan K. Taylor 2021-11-01 15:52:55 +00:00
parent 2dee1dbc28
commit 8865bb73ba
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -163,32 +163,28 @@ class BanEntry{
}else{
$str = explode("|", trim($str));
$entry = new BanEntry(trim(array_shift($str)));
do{
if(count($str) === 0){
break;
}
if(count($str) === 0){
return $entry;
}
$entry->setCreated(self::parseDate(array_shift($str)));
if(count($str) === 0){
break;
}
$entry->setCreated(self::parseDate(array_shift($str)));
if(count($str) === 0){
return $entry;
}
$entry->setSource(trim(array_shift($str)));
if(count($str) === 0){
break;
}
$expire = trim(array_shift($str));
if($expire !== "" and strtolower($expire) !== "forever"){
$entry->setExpires(self::parseDate($expire));
}
if(count($str) === 0){
break;
}
$entry->setReason(trim(array_shift($str)));
}while(false);
$entry->setSource(trim(array_shift($str)));
if(count($str) === 0){
return $entry;
}
$expire = trim(array_shift($str));
if($expire !== "" and strtolower($expire) !== "forever"){
$entry->setExpires(self::parseDate($expire));
}
if(count($str) === 0){
return $entry;
}
$entry->setReason(trim(array_shift($str)));
return $entry;
}
}