Cleaned up code

This commit is contained in:
Shoghi Cervantes
2015-01-03 16:07:49 +01:00
parent f9762c870a
commit 074c8b876d
19 changed files with 27 additions and 1293 deletions

View File

@ -173,12 +173,13 @@ class Permission{
* @param string|Permission $name
* @param $value
*
* @return Permission|void
* @return Permission|void Permission if $name is a string, void if it's a Permission
*/
public function addParent($name, $value){
if($name instanceof Permission){
$name->getChildren()[$this->getName()] = $value;
$name->recalculatePermissibles();
return;
}else{
$perm = Server::getInstance()->getPluginManager()->getPermission($name);
if($perm === null){