mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Removed PermissionRemovedExecutor
this interface is just about the most pointless code in all of PM or Bukkit. In over 4 million lines of code on Poggit, a Google search and a GitHub search, I didn't find a single usage of it that wasn't just bukkit internals code copy pasta, a spoon, a port of PM/Bukkit/whatever into a different language, or someone's generated javadoc.
This commit is contained in:
parent
b525f45bf8
commit
408e29da90
@ -130,9 +130,6 @@ class PermissibleInternal implements Permissible{
|
|||||||
if(isset($this->attachments[spl_object_id($attachment)])){
|
if(isset($this->attachments[spl_object_id($attachment)])){
|
||||||
unset($this->attachments[spl_object_id($attachment)]);
|
unset($this->attachments[spl_object_id($attachment)]);
|
||||||
$attachment->unsubscribePermissible($this);
|
$attachment->unsubscribePermissible($this);
|
||||||
if(($ex = $attachment->getRemovalCallback()) !== null){
|
|
||||||
$ex->attachmentRemoved($this, $attachment);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->recalculatePermissions();
|
$this->recalculatePermissions();
|
||||||
|
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\plugin\PluginException;
|
|||||||
use function spl_object_id;
|
use function spl_object_id;
|
||||||
|
|
||||||
class PermissionAttachment{
|
class PermissionAttachment{
|
||||||
/** @var PermissionRemovedExecutor|null */
|
|
||||||
private $removed = null;
|
|
||||||
|
|
||||||
/** @var bool[] */
|
/** @var bool[] */
|
||||||
private $permissions = [];
|
private $permissions = [];
|
||||||
|
|
||||||
@ -58,14 +55,6 @@ class PermissionAttachment{
|
|||||||
return $this->plugin;
|
return $this->plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRemovalCallback(PermissionRemovedExecutor $ex) : void{
|
|
||||||
$this->removed = $ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRemovalCallback() : ?PermissionRemovedExecutor{
|
|
||||||
return $this->removed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PermissibleInternal[]
|
* @return PermissibleInternal[]
|
||||||
* @phpstan-return array<int, PermissibleInternal>
|
* @phpstan-return array<int, PermissibleInternal>
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\permission;
|
|
||||||
|
|
||||||
interface PermissionRemovedExecutor{
|
|
||||||
|
|
||||||
public function attachmentRemoved(Permissible $permissible, PermissionAttachment $attachment) : void;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user