mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 19:24:12 +00:00
Replace empty() usages with count()
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\permission;
|
||||
|
||||
use function array_shift;
|
||||
use function count;
|
||||
use function explode;
|
||||
use function implode;
|
||||
use function strlen;
|
||||
@ -161,17 +162,17 @@ class BanEntry{
|
||||
$str = explode("|", trim($str));
|
||||
$entry = new BanEntry(trim(array_shift($str)));
|
||||
do{
|
||||
if(empty($str)){
|
||||
if(count($str) === 0){
|
||||
break;
|
||||
}
|
||||
|
||||
$entry->setCreated(self::parseDate(array_shift($str)));
|
||||
if(empty($str)){
|
||||
if(count($str) === 0){
|
||||
break;
|
||||
}
|
||||
|
||||
$entry->setSource(trim(array_shift($str)));
|
||||
if(empty($str)){
|
||||
if(count($str) === 0){
|
||||
break;
|
||||
}
|
||||
|
||||
@ -179,7 +180,7 @@ class BanEntry{
|
||||
if($expire !== "" and strtolower($expire) !== "forever"){
|
||||
$entry->setExpires(self::parseDate($expire));
|
||||
}
|
||||
if(empty($str)){
|
||||
if(count($str) === 0){
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class PermissionManager{
|
||||
public function unsubscribeFromAllPermissions(Permissible $permissible) : void{
|
||||
foreach($this->permSubs as $permission => &$subs){
|
||||
unset($subs[spl_object_hash($permissible)]);
|
||||
if(empty($subs)){
|
||||
if(count($subs) === 0){
|
||||
unset($this->permSubs[$permission]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user