diff --git a/src/permission/PermissibleBase.php b/src/permission/PermissibleBase.php index b7613006f5..249b12436f 100644 --- a/src/permission/PermissibleBase.php +++ b/src/permission/PermissibleBase.php @@ -140,7 +140,7 @@ class PermissibleBase implements Permissible{ if($perm === null){ throw new \InvalidStateException("Unregistered root permission $name"); } - $this->permissions[$name] = new PermissionAttachmentInfo($this->getRootPermissible(), $name, null, $isGranted); + $this->permissions[$name] = new PermissionAttachmentInfo($name, null, $isGranted); $permManager->subscribeToPermission($name, $this->getRootPermissible()); $this->calculateChildPermissions($perm->getChildren(), false, null); } @@ -166,7 +166,7 @@ class PermissibleBase implements Permissible{ foreach($children as $name => $v){ $perm = $permManager->getPermission($name); $value = ($v xor $invert); - $this->permissions[$name] = new PermissionAttachmentInfo($this->getRootPermissible(), $name, $attachment, $value); + $this->permissions[$name] = new PermissionAttachmentInfo($name, $attachment, $value); $permManager->subscribeToPermission($name, $this->getRootPermissible()); if($perm instanceof Permission){ diff --git a/src/permission/PermissionAttachmentInfo.php b/src/permission/PermissionAttachmentInfo.php index 0ed5e003a6..3bb4f0c5b3 100644 --- a/src/permission/PermissionAttachmentInfo.php +++ b/src/permission/PermissionAttachmentInfo.php @@ -24,9 +24,6 @@ declare(strict_types=1); namespace pocketmine\permission; class PermissionAttachmentInfo{ - /** @var Permissible */ - private $permissible; - /** @var string */ private $permission; @@ -36,17 +33,12 @@ class PermissionAttachmentInfo{ /** @var bool */ private $value; - public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){ - $this->permissible = $permissible; + public function __construct(string $permission, ?PermissionAttachment $attachment, bool $value){ $this->permission = $permission; $this->attachment = $attachment; $this->value = $value; } - public function getPermissible() : Permissible{ - return $this->permissible; - } - public function getPermission() : string{ return $this->permission; }