Added typehints and PhpDoc for events API

excluded blocks and entities events API to avoid merge conflicts
This commit is contained in:
Dylan K. Taylor
2017-07-05 16:42:06 +01:00
parent 6504fdabab
commit 6cd4d2c5a2
57 changed files with 461 additions and 198 deletions

View File

@ -46,10 +46,10 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
* @param Item $bucket
* @param Item $itemInHand
*/
public function __construct(Player $who, Block $blockClicked, $blockFace, Item $bucket, Item $itemInHand){
public function __construct(Player $who, Block $blockClicked, int $blockFace, Item $bucket, Item $itemInHand){
$this->player = $who;
$this->blockClicked = $blockClicked;
$this->blockFace = (int) $blockFace;
$this->blockFace = $blockFace;
$this->item = $itemInHand;
$this->bucket = $bucket;
}
@ -59,7 +59,7 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
*
* @return Item
*/
public function getBucket(){
public function getBucket() : Item{
return $this->bucket;
}
@ -68,7 +68,7 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
*
* @return Item
*/
public function getItem(){
public function getItem() : Item{
return $this->item;
}
@ -82,14 +82,14 @@ abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable{
/**
* @return Block
*/
public function getBlockClicked(){
public function getBlockClicked() : Block{
return $this->blockClicked;
}
/**
* @return int
*/
public function getBlockFace(){
public function getBlockFace() : int{
return $this->blockFace;
}
}