mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
BanEntry: remove useless do/while
This commit is contained in:
parent
2dee1dbc28
commit
8865bb73ba
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user