Permission: remove dead code

Bukkit CCC at its finest... what the fuck this was doing anyway I have no idea
an addChild() method would have made far more sense, especially considering that addParent() doesn't actually mutate the child.
This commit is contained in:
Dylan K. Taylor 2020-11-27 19:56:39 +00:00
parent c454441646
commit 1de486733a

View File

@ -116,27 +116,4 @@ class Permission{
$p->recalculatePermissions();
}
}
/**
* @param string|Permission $name
*
* @return Permission|null Permission if $name is a string, null if it's a Permission
*/
public function addParent($name, bool $value) : ?Permission{
if($name instanceof Permission){
$name->getChildren()[$this->getName()] = $value;
$name->recalculatePermissibles();
return null;
}else{
$perm = PermissionManager::getInstance()->getPermission($name);
if($perm === null){
$perm = new Permission($name);
PermissionManager::getInstance()->addPermission($perm);
}
$this->addParent($perm, $value);
return $perm;
}
}
}