From 1de486733aedfbfe5c687ed9c6b7aff721d48282 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 27 Nov 2020 19:56:39 +0000 Subject: [PATCH] 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. --- src/permission/Permission.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/permission/Permission.php b/src/permission/Permission.php index 9361dea24..02066b26d 100644 --- a/src/permission/Permission.php +++ b/src/permission/Permission.php @@ -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; - } - } }