Added Inventory interfaces and types, updated long array() to []

This commit is contained in:
Shoghi Cervantes
2014-05-22 18:59:16 +02:00
parent 0be679c9d5
commit 6cbd39de9b
102 changed files with 637 additions and 334 deletions

View File

@ -34,12 +34,12 @@ class HandlerList{
/**
* @var RegisteredListener[][]
*/
private $handlerSlots = array();
private $handlerSlots = [];
/**
* @var HandlerList[]
*/
private static $allLists = array();
private static $allLists = [];
public static function bakeAll(){
foreach(self::$allLists as $h){
@ -61,7 +61,7 @@ class HandlerList{
}else{
foreach(self::$allLists as $h){
foreach($h->handlerSlots as $key => $list){
$h->handlerSlots[$key] = array();
$h->handlerSlots[$key] = [];
}
$h->handlers = null;
}
@ -70,12 +70,12 @@ class HandlerList{
public function __construct(){
$this->handlerSlots = array(
EventPriority::MONITOR => array(),
EventPriority::HIGHEST => array(),
EventPriority::HIGH => array(),
EventPriority::NORMAL => array(),
EventPriority::LOW => array(),
EventPriority::LOWEST => array()
EventPriority::MONITOR => [],
EventPriority::HIGHEST => [],
EventPriority::HIGH => [],
EventPriority::NORMAL => [],
EventPriority::LOW => [],
EventPriority::LOWEST => []
);
self::$allLists[] = $this;
}
@ -133,7 +133,7 @@ class HandlerList{
if($this->handlers !== null){
return;
}
$entries = array();
$entries = [];
foreach($this->handlerSlots as $list){
foreach($list as $hash => $listener){
$entries[$hash] = $listener;
@ -149,7 +149,7 @@ class HandlerList{
*/
public function getRegisteredListeners($plugin = null){
if($plugin instanceof Plugin){
$listeners = array();
$listeners = [];
foreach($this->getRegisteredListeners(null) as $hash => $listener){
if($listener->getPlugin() === $plugin){
$listeners[$hash] = $plugin;

View File

@ -40,7 +40,7 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
/**
* @var Player[]
*/
protected $recipients = array();
protected $recipients = [];
public function __construct(Player $player, $message, $format = "<%s> %s", array $recipients = null){
$this->player = $player;