mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Added typehints and PhpDoc for events API
excluded blocks and entities events API to avoid merge conflicts
This commit is contained in:
@ -44,7 +44,13 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
*/
|
||||
protected $recipients = [];
|
||||
|
||||
public function __construct(Player $player, $message, $format = "chat.type.text", array $recipients = null){
|
||||
/**
|
||||
* @param Player $player
|
||||
* @param string $message
|
||||
* @param string $format
|
||||
* @param Player[] $recipients
|
||||
*/
|
||||
public function __construct(Player $player, string $message, string $format = "chat.type.text", array $recipients = null){
|
||||
$this->player = $player;
|
||||
$this->message = $message;
|
||||
|
||||
@ -57,11 +63,17 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
}
|
||||
}
|
||||
|
||||
public function getMessage(){
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage() : string{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function setMessage($message){
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function setMessage(string $message){
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
@ -74,18 +86,30 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
public function getFormat(){
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getFormat() : string{
|
||||
return $this->format;
|
||||
}
|
||||
|
||||
public function setFormat($format){
|
||||
/**
|
||||
* @param string $format
|
||||
*/
|
||||
public function setFormat(string $format){
|
||||
$this->format = $format;
|
||||
}
|
||||
|
||||
public function getRecipients(){
|
||||
/**
|
||||
* @return Player[]
|
||||
*/
|
||||
public function getRecipients() : array{
|
||||
return $this->recipients;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Player[] $recipients
|
||||
*/
|
||||
public function setRecipients(array $recipients){
|
||||
$this->recipients = $recipients;
|
||||
}
|
||||
|
Reference in New Issue
Block a user