mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
PermissibleBase: removed nonsensical code
it's not possible for this to be null, unless a child class doesn't call the constructor, and anything could break in that case anyway.
This commit is contained in:
parent
7ee98ff139
commit
23829952c3
@ -30,7 +30,7 @@ use pocketmine\timings\Timings;
|
||||
|
||||
class PermissibleBase implements Permissible{
|
||||
/** @var ServerOperator */
|
||||
private $opable = null;
|
||||
private $opable;
|
||||
|
||||
/** @var Permissible */
|
||||
private $parent = null;
|
||||
@ -59,24 +59,14 @@ class PermissibleBase implements Permissible{
|
||||
* @return bool
|
||||
*/
|
||||
public function isOp() : bool{
|
||||
if($this->opable === null){
|
||||
return false;
|
||||
}else{
|
||||
return $this->opable->isOp();
|
||||
}
|
||||
return $this->opable->isOp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function setOp(bool $value){
|
||||
if($this->opable === null){
|
||||
throw new \LogicException("Cannot change op value as no ServerOperator is set");
|
||||
}else{
|
||||
$this->opable->setOp($value);
|
||||
}
|
||||
$this->opable->setOp($value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user