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,7 +46,7 @@ abstract class ChunkEvent extends LevelEvent{
/**
* @return Chunk
*/
public function getChunk(){
public function getChunk() : Chunk{
return $this->chunk;
}
}

View File

@ -33,6 +33,7 @@ use pocketmine\level\format\Chunk;
class ChunkLoadEvent extends ChunkEvent{
public static $handlerList = null;
/** @var bool */
private $newChunk;
public function __construct(Level $level, Chunk $chunk, bool $newChunk){
@ -43,7 +44,7 @@ class ChunkLoadEvent extends ChunkEvent{
/**
* @return bool
*/
public function isNewChunk(){
public function isNewChunk() : bool{
return $this->newChunk;
}
}

View File

@ -43,7 +43,7 @@ abstract class LevelEvent extends Event{
/**
* @return Level
*/
public function getLevel(){
public function getLevel() : Level{
return $this->level;
}
}

View File

@ -48,7 +48,7 @@ class SpawnChangeEvent extends LevelEvent{
/**
* @return Position
*/
public function getPreviousSpawn(){
public function getPreviousSpawn() : Position{
return $this->previousSpawn;
}
}