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

@ -26,7 +26,7 @@ use pocketmine\Server;
class BanList{
/** @var BanEntry[] */
private $list = array();
private $list = [];
/** @var string */
private $file;
@ -128,7 +128,7 @@ class BanList{
}
public function load(){
$this->list = array();
$this->list = [];
$fp = @fopen($this->file, "r");
if(is_resource($fp)){
while(($line = fgets($fp)) !== false){

View File

@ -34,12 +34,12 @@ class PermissibleBase implements Permissible{
/**
* @var PermissionAttachment[]
*/
private $attachments = array();
private $attachments = [];
/**
* @var PermissionAttachmentInfo[]
*/
private $permissions = array();
private $permissions = [];
/**
* @param ServerOperator $opable
@ -190,7 +190,7 @@ class PermissibleBase implements Permissible{
Server::getInstance()->getPluginManager()->unsubscribeFromDefaultPerms(false, $this->parent);
Server::getInstance()->getPluginManager()->unsubscribeFromDefaultPerms(true, $this->parent);
$this->permissions = array();
$this->permissions = [];
}
/**

View File

@ -84,7 +84,7 @@ class Permission{
/**
* @var string[]
*/
private $children = array();
private $children = [];
/** @var string */
private $defaultValue;
@ -97,7 +97,7 @@ class Permission{
* @param string $defaultValue
* @param Permission[] $children
*/
public function __construct($name, $description = null, $defaultValue = null, array $children = array()){
public function __construct($name, $description = null, $defaultValue = null, array $children = []){
$this->name = $name;
$this->description = $description !== null ? $description : "";
$this->defaultValue = $defaultValue !== null ? $defaultValue : self::$DEFAULT_PERMISSION;
@ -199,7 +199,7 @@ class Permission{
* @return Permission[]
*/
public static function loadPermissions(array $data, $default = self::DEFAULT_OP){
$result = array();
$result = [];
foreach($data as $key => $entry){
$result[] = self::loadPermission($key, $entry, $default, $result);
}
@ -215,9 +215,9 @@ class Permission{
*
* @return Permission
*/
public static function loadPermission($name, array $data, $default = self::DEFAULT_OP, &$output = array()){
public static function loadPermission($name, array $data, $default = self::DEFAULT_OP, &$output = []){
$desc = null;
$children = array();
$children = [];
if(isset($data["default"])){
$value = Permission::getByName($data["default"]);
if($value !== null){

View File

@ -30,7 +30,7 @@ class PermissionAttachment{
/**
* @var bool[]
*/
private $permissions = array();
private $permissions = [];
/** @var Permissible */
private $permissible;