mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Event: More detailed errors for non-cancellable events
This commit is contained in:
parent
1cbb31f1db
commit
9ed1b5ca7f
@ -50,7 +50,7 @@ abstract class Event{
|
|||||||
*/
|
*/
|
||||||
public function isCancelled() : bool{
|
public function isCancelled() : bool{
|
||||||
if(!($this instanceof Cancellable)){
|
if(!($this instanceof Cancellable)){
|
||||||
throw new \BadMethodCallException("Event is not Cancellable");
|
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Event $this */
|
/** @var Event $this */
|
||||||
@ -64,7 +64,7 @@ abstract class Event{
|
|||||||
*/
|
*/
|
||||||
public function setCancelled(bool $value = true) : void{
|
public function setCancelled(bool $value = true) : void{
|
||||||
if(!($this instanceof Cancellable)){
|
if(!($this instanceof Cancellable)){
|
||||||
throw new \BadMethodCallException("Event is not Cancellable");
|
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Event $this */
|
/** @var Event $this */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user