mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added Inventory interfaces and types, updated long array() to []
This commit is contained in:
@ -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){
|
||||
|
@ -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 = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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){
|
||||
|
@ -30,7 +30,7 @@ class PermissionAttachment{
|
||||
/**
|
||||
* @var bool[]
|
||||
*/
|
||||
private $permissions = array();
|
||||
private $permissions = [];
|
||||
|
||||
/** @var Permissible */
|
||||
private $permissible;
|
||||
|
Reference in New Issue
Block a user