eliminate remaining empty() usages

This commit is contained in:
Dylan K. Taylor
2020-02-07 21:46:16 +00:00
parent 1ffabbb567
commit aac7da6c96
22 changed files with 40 additions and 30 deletions

View File

@@ -182,7 +182,7 @@ class WorldManager{
if(count($providers) !== 1){
$this->server->getLogger()->error($this->server->getLanguage()->translateString("pocketmine.level.loadError", [
$name,
empty($providers) ?
count($providers) === 0 ?
$this->server->getLanguage()->translateString("pocketmine.level.unknownFormat") :
$this->server->getLanguage()->translateString("pocketmine.level.ambiguousFormat", [implode(", ", array_keys($providers))])
]));
@@ -302,7 +302,7 @@ class WorldManager{
}
$path = $this->server->getDataPath() . "worlds/" . $name . "/";
if(!($this->getWorldByName($name) instanceof World)){
return !empty(WorldProviderManager::getMatchingProviders($path));
return count(WorldProviderManager::getMatchingProviders($path)) > 0;
}
return true;