mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Removed a couple of useless null checks from PermissibleBase
This commit is contained in:
parent
7f09a2a26e
commit
edf1fbb6e6
@ -127,9 +127,7 @@ class PermissibleBase implements Permissible{
|
||||
* @throws PluginException
|
||||
*/
|
||||
public function addAttachment(Plugin $plugin, $name = null, $value = null){
|
||||
if($plugin === null){
|
||||
throw new PluginException("Plugin cannot be null");
|
||||
}elseif(!$plugin->isEnabled()){
|
||||
if(!$plugin->isEnabled()){
|
||||
throw new PluginException("Plugin " . $plugin->getDescription()->getName() . " is disabled");
|
||||
}
|
||||
|
||||
@ -146,14 +144,8 @@ class PermissibleBase implements Permissible{
|
||||
|
||||
/**
|
||||
* @param PermissionAttachment $attachment
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function removeAttachment(PermissionAttachment $attachment){
|
||||
if($attachment === null){
|
||||
throw new \InvalidStateException("Attachment cannot be null");
|
||||
}
|
||||
|
||||
if(isset($this->attachments[spl_object_hash($attachment)])){
|
||||
unset($this->attachments[spl_object_hash($attachment)]);
|
||||
if(($ex = $attachment->getRemovalCallback()) !== null){
|
||||
|
Loading…
x
Reference in New Issue
Block a user