mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Replace disallowed operators in src/event/
This commit is contained in:
parent
22fb02c4e6
commit
aa6bd4438a
@ -65,11 +65,11 @@ class HandlerList{
|
||||
* @param RegisteredListener|Listener|Plugin $object
|
||||
*/
|
||||
public function unregister($object) : void{
|
||||
if($object instanceof Plugin or $object instanceof Listener){
|
||||
if($object instanceof Plugin || $object instanceof Listener){
|
||||
foreach($this->handlerSlots as $priority => $list){
|
||||
foreach($list as $hash => $listener){
|
||||
if(($object instanceof Plugin and $listener->getPlugin() === $object)
|
||||
or ($object instanceof Listener and (new \ReflectionFunction($listener->getHandler()))->getClosureThis() === $object) //this doesn't even need to be a listener :D
|
||||
if(($object instanceof Plugin && $listener->getPlugin() === $object)
|
||||
|| ($object instanceof Listener && (new \ReflectionFunction($listener->getHandler()))->getClosureThis() === $object) //this doesn't even need to be a listener :D
|
||||
){
|
||||
unset($this->handlerSlots[$priority][$hash]);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class HandlerListManager{
|
||||
* @param Plugin|Listener|RegisteredListener|null $object
|
||||
*/
|
||||
public function unregisterAll($object = null) : void{
|
||||
if($object instanceof Listener or $object instanceof Plugin or $object instanceof RegisteredListener){
|
||||
if($object instanceof Listener || $object instanceof Plugin || $object instanceof RegisteredListener){
|
||||
foreach($this->allLists as $h){
|
||||
$h->unregister($object);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class RegisteredListener{
|
||||
}
|
||||
|
||||
public function callEvent(Event $event) : void{
|
||||
if($event instanceof Cancellable and $event->isCancelled() and !$this->isHandlingCancelled()){
|
||||
if($event instanceof Cancellable && $event->isCancelled() && !$this->isHandlingCancelled()){
|
||||
return;
|
||||
}
|
||||
$this->timings->startTiming();
|
||||
|
Loading…
x
Reference in New Issue
Block a user