populate remaining missing return types, using native returns where possible

this is done separately to stable so that stable changes can be integrated easily using an empty merge.
This commit is contained in:
Dylan K. Taylor
2020-01-19 10:26:35 +00:00
parent 3cf0b50b4a
commit 3ee6887792
17 changed files with 97 additions and 85 deletions

View File

@ -38,7 +38,7 @@ final class CreativeInventory{
//NOOP
}
public static function init(){
public static function init() : void{
self::clear();
$creativeItems = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "creativeitems.json"), true);
@ -56,7 +56,7 @@ final class CreativeInventory{
* Removes all previously added items from the creative menu.
* Note: Players who are already online when this is called will not see this change.
*/
public static function clear(){
public static function clear() : void{
self::$creative = [];
}
@ -92,7 +92,7 @@ final class CreativeInventory{
*
* @param Item $item
*/
public static function add(Item $item){
public static function add(Item $item) : void{
self::$creative[] = clone $item;
}
@ -102,7 +102,7 @@ final class CreativeInventory{
*
* @param Item $item
*/
public static function remove(Item $item){
public static function remove(Item $item) : void{
$index = self::getItemIndex($item);
if($index !== -1){
unset(self::$creative[$index]);