Reformatting, removing unused imports

This commit is contained in:
Shoghi Cervantes 2014-03-28 12:57:08 +01:00
parent fd8e5b27e5
commit 38809f7da2
49 changed files with 285 additions and 224 deletions

View File

@ -71,7 +71,6 @@ use PocketMine\Tile\Tile;
use PocketMine\Utils\Config; use PocketMine\Utils\Config;
use PocketMine\Utils\TextFormat; use PocketMine\Utils\TextFormat;
use PocketMine\Utils\Utils; use PocketMine\Utils\Utils;
use PocketMine\Command\CommandSender;
/** /**
* Main class that handles networking, recovery, and packet sending to the server part * Main class that handles networking, recovery, and packet sending to the server part

View File

@ -32,7 +32,6 @@ use PocketMine\Command\ConsoleCommandSender;
use PocketMine\Command\PluginCommand; use PocketMine\Command\PluginCommand;
use PocketMine\Command\SimpleCommandMap; use PocketMine\Command\SimpleCommandMap;
use PocketMine\Entity\Entity; use PocketMine\Entity\Entity;
use PocketMine\Event\Event;
use PocketMine\Event\HandlerList; use PocketMine\Event\HandlerList;
use PocketMine\Event\Server\PacketReceiveEvent; use PocketMine\Event\Server\PacketReceiveEvent;
use PocketMine\Event\Server\PacketSendEvent; use PocketMine\Event\Server\PacketSendEvent;

View File

@ -21,17 +21,10 @@
namespace PocketMine; namespace PocketMine;
use PocketMine\Block\Block;
use PocketMine\Entity\Entity;
use PocketMine\Item\Item;
use PocketMine\Level\Level;
use PocketMine\Network\Protocol\Info;
use PocketMine\Network\Query\QueryHandler; use PocketMine\Network\Query\QueryHandler;
use PocketMine\Network\RCON\RCON; use PocketMine\Network\RCON\RCON;
use PocketMine\Network\UPnP\UPnP; use PocketMine\Network\UPnP\UPnP;
use PocketMine\Plugin\PluginManager; use PocketMine\Plugin\PluginManager;
use PocketMine\Recipes\Crafting;
use PocketMine\Tile\Tile;
use PocketMine\Utils\Config; use PocketMine\Utils\Config;
use PocketMine\Utils\TextFormat; use PocketMine\Utils\TextFormat;
use PocketMine\Utils\Utils; use PocketMine\Utils\Utils;
@ -261,7 +254,6 @@ class ServerAPI{
} }
if($this->getProperty("send-usage", true) !== false){ if($this->getProperty("send-usage", true) !== false){
$this->server->schedule(6000, array($this, "sendUsage"), array(), true); //Send the info after 5 minutes have passed $this->server->schedule(6000, array($this, "sendUsage"), array(), true); //Send the info after 5 minutes have passed
$this->sendUsage(); $this->sendUsage();

View File

@ -89,6 +89,7 @@ class ServerOld{
if(isset(self::$instance)){ if(isset(self::$instance)){
return self::$instance; return self::$instance;
} }
return null; return null;
} }

View File

@ -22,7 +22,6 @@
namespace PocketMine\Block; namespace PocketMine\Block;
class Furnace extends BurningFurnace{ class Furnace extends BurningFurnace{
public function __construct($meta = 0){ public function __construct($meta = 0){
parent::__construct($meta); parent::__construct($meta);

View File

@ -174,8 +174,10 @@ abstract class Command{
$this->nextLabel = $name; $this->nextLabel = $name;
if(!$this->isRegistered()){ if(!$this->isRegistered()){
$this->label = $name; $this->label = $name;
return true; return true;
} }
return false; return false;
} }
@ -189,8 +191,10 @@ abstract class Command{
public function register(CommandMap $commandMap){ public function register(CommandMap $commandMap){
if($this->allowChangesFrom($commandMap)){ if($this->allowChangesFrom($commandMap)){
$this->commandMap = $commandMap; $this->commandMap = $commandMap;
return true; return true;
} }
return false; return false;
} }
@ -204,8 +208,10 @@ abstract class Command{
$this->commandMap = null; $this->commandMap = null;
$this->activeAliases = $this->aliases; $this->activeAliases = $this->aliases;
$this->label = $this->nextLabel; $this->label = $this->nextLabel;
return true; return true;
} }
return false; return false;
} }

View File

@ -67,6 +67,7 @@ class CommandReader extends \Thread{
return $this->buffer->shift(); return $this->buffer->shift();
}); });
} }
return null; return null;
} }

View File

@ -23,7 +23,6 @@ namespace PocketMine\Command;
use PocketMine\Permission\PermissibleBase; use PocketMine\Permission\PermissibleBase;
use PocketMine\Permission\PermissionAttachment; use PocketMine\Permission\PermissionAttachment;
use PocketMine\Player;
use PocketMine\Plugin\Plugin; use PocketMine\Plugin\Plugin;
use PocketMine\Server; use PocketMine\Server;

View File

@ -21,13 +21,13 @@
namespace PocketMine\Command; namespace PocketMine\Command;
use PocketMine\Command\Defaults\HelpCommand;
use PocketMine\Command\Defaults\PluginsCommand; use PocketMine\Command\Defaults\PluginsCommand;
use PocketMine\Command\Defaults\SeedCommand;
use PocketMine\Command\Defaults\StopCommand; use PocketMine\Command\Defaults\StopCommand;
use PocketMine\Command\Defaults\TellCommand; use PocketMine\Command\Defaults\TellCommand;
use PocketMine\Command\Defaults\VanillaCommand; use PocketMine\Command\Defaults\VanillaCommand;
use PocketMine\Command\Defaults\VersionCommand; use PocketMine\Command\Defaults\VersionCommand;
use PocketMine\Command\Defaults\SeedCommand;
use PocketMine\Command\Defaults\HelpCommand;
use PocketMine\Server; use PocketMine\Server;
class SimpleCommandMap implements CommandMap{ class SimpleCommandMap implements CommandMap{
@ -140,6 +140,7 @@ class SimpleCommandMap implements CommandMap{
if(isset($this->knownCommands[$name])){ if(isset($this->knownCommands[$name])){
return $this->knownCommands[$name]; return $this->knownCommands[$name];
} }
return null; return null;
} }

View File

@ -21,11 +21,11 @@
namespace PocketMine\Command\Defaults; namespace PocketMine\Command\Defaults;
use PocketMine\Command\Command;
use PocketMine\Command\CommandSender; use PocketMine\Command\CommandSender;
use PocketMine\Utils\TextFormat;
use PocketMine\Command\ConsoleCommandSender; use PocketMine\Command\ConsoleCommandSender;
use PocketMine\Server; use PocketMine\Server;
use PocketMine\Command\Command; use PocketMine\Utils\TextFormat;
class HelpCommand extends VanillaCommand{ class HelpCommand extends VanillaCommand{
@ -84,6 +84,7 @@ class HelpCommand extends VanillaCommand{
} }
} }
$sender->sendMessage($message); $sender->sendMessage($message);
return true; return true;
}else{ }else{
if(($command = Server::getInstance()->getCommandMap()->getCommand(strtolower($command))) instanceof Command){ if(($command = Server::getInstance()->getCommandMap()->getCommand(strtolower($command))) instanceof Command){
@ -92,10 +93,12 @@ class HelpCommand extends VanillaCommand{
$message .= TextFormat::DARK_GREEN . "Description: " . TextFormat::WHITE . $command->getDescription() . "\n"; $message .= TextFormat::DARK_GREEN . "Description: " . TextFormat::WHITE . $command->getDescription() . "\n";
$message .= TextFormat::DARK_GREEN . "Usage: " . TextFormat::WHITE . implode("\n" . TextFormat::WHITE, explode("\n", $command->getUsage())) . "\n"; $message .= TextFormat::DARK_GREEN . "Usage: " . TextFormat::WHITE . implode("\n" . TextFormat::WHITE, explode("\n", $command->getUsage())) . "\n";
$sender->sendMessage($message); $sender->sendMessage($message);
return true; return true;
} }
} }
$sender->sendMessage(TextFormat::RED . "No help for " . strtolower($command)); $sender->sendMessage(TextFormat::RED . "No help for " . strtolower($command));
return true; return true;
} }
} }

View File

@ -22,9 +22,8 @@
namespace PocketMine\Command\Defaults; namespace PocketMine\Command\Defaults;
use PocketMine\Command\CommandSender; use PocketMine\Command\CommandSender;
use PocketMine\Utils\TextFormat;
use PocketMine\Player;
use PocketMine\Level\Level; use PocketMine\Level\Level;
use PocketMine\Player;
class SeedCommand extends VanillaCommand{ class SeedCommand extends VanillaCommand{

View File

@ -23,8 +23,8 @@ namespace PocketMine\Command\Defaults;
use PocketMine\Command\Command; use PocketMine\Command\Command;
use PocketMine\Command\CommandSender; use PocketMine\Command\CommandSender;
use PocketMine\Server;
use PocketMine\Player; use PocketMine\Player;
use PocketMine\Server;
class StopCommand extends VanillaCommand{ class StopCommand extends VanillaCommand{

View File

@ -22,9 +22,8 @@
namespace PocketMine\Command\Defaults; namespace PocketMine\Command\Defaults;
use PocketMine\Command\CommandSender; use PocketMine\Command\CommandSender;
use PocketMine\Utils\TextFormat;
use PocketMine\Player; use PocketMine\Player;
use PocketMine\Level\Level; use PocketMine\Utils\TextFormat;
class TellCommand extends VanillaCommand{ class TellCommand extends VanillaCommand{
@ -45,6 +44,7 @@ class TellCommand extends VanillaCommand{
if(count($args) < 2){ if(count($args) < 2){
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage); $sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
return false; return false;
} }

View File

@ -48,8 +48,10 @@ abstract class VanillaCommand extends Command{
protected function getRelativeDouble($original, CommandSender $sender, $input){ protected function getRelativeDouble($original, CommandSender $sender, $input){
if($input{0} === "~"){ if($input{0} === "~"){
$value = $this->getDouble($sender, substr($input, 1)); $value = $this->getDouble($sender, substr($input, 1));
return $original + $value; return $original + $value;
} }
return $this->getDouble($input); return $this->getDouble($input);
} }

View File

@ -56,6 +56,7 @@ class VersionCommand extends VanillaCommand{
if($exactPlugin instanceof Plugin){ if($exactPlugin instanceof Plugin){
$this->describeToSender($exactPlugin, $sender); $this->describeToSender($exactPlugin, $sender);
return true; return true;
} }

View File

@ -29,17 +29,16 @@ use PocketMine\Event\Entity\EntityLevelChangeEvent;
use PocketMine\Event\Entity\EntityMotionEvent; use PocketMine\Event\Entity\EntityMotionEvent;
use PocketMine\Event\Entity\EntityMoveEvent; use PocketMine\Event\Entity\EntityMoveEvent;
use PocketMine\Event\Entity\EntitySpawnEvent; use PocketMine\Event\Entity\EntitySpawnEvent;
use PocketMine\Event\Event;
use PocketMine\Level\Level; use PocketMine\Level\Level;
use PocketMine\Level\Position; use PocketMine\Level\Position;
use PocketMine\Math\AxisAlignedBB; use PocketMine\Math\AxisAlignedBB;
use PocketMine\Math\Vector3 as Vector3; use PocketMine\Math\Vector3 as Vector3;
use PocketMine\NBT\Tag\Compound; use PocketMine\NBT\Tag\Compound;
use PocketMine\Network;
use PocketMine\Network\Protocol\MoveEntityPacket_PosRot; use PocketMine\Network\Protocol\MoveEntityPacket_PosRot;
use PocketMine\Network\Protocol\MovePlayerPacket; use PocketMine\Network\Protocol\MovePlayerPacket;
use PocketMine\Network\Protocol\RemoveEntityPacket; use PocketMine\Network\Protocol\RemoveEntityPacket;
use PocketMine\Network\Protocol\SetEntityMotionPacket; use PocketMine\Network\Protocol\SetEntityMotionPacket;
use PocketMine\Network;
use PocketMine\Player; use PocketMine\Player;
use PocketMine\PMF\LevelFormat; use PocketMine\PMF\LevelFormat;
use PocketMine\Server; use PocketMine\Server;

View File

@ -23,19 +23,18 @@ namespace PocketMine\Entity;
use PocketMine\Event\Entity\EntityArmorChangeEvent; use PocketMine\Event\Entity\EntityArmorChangeEvent;
use PocketMine\Event\Entity\EntityInventoryChangeEvent; use PocketMine\Event\Entity\EntityInventoryChangeEvent;
use PocketMine\Event\Event;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\NBT\NBT; use PocketMine\NBT\NBT;
use PocketMine\NBT\Tag\Byte; use PocketMine\NBT\Tag\Byte;
use PocketMine\NBT\Tag\Compound; use PocketMine\NBT\Tag\Compound;
use PocketMine\NBT\Tag\Enum; use PocketMine\NBT\Tag\Enum;
use PocketMine\NBT\Tag\Short; use PocketMine\NBT\Tag\Short;
use PocketMine\Network;
use PocketMine\Network\Protocol\AddPlayerPacket; use PocketMine\Network\Protocol\AddPlayerPacket;
use PocketMine\Network\Protocol\ContainerSetContentPacket; use PocketMine\Network\Protocol\ContainerSetContentPacket;
use PocketMine\Network\Protocol\PlayerEquipmentPacket; use PocketMine\Network\Protocol\PlayerEquipmentPacket;
use PocketMine\Network\Protocol\RemovePlayerPacket; use PocketMine\Network\Protocol\RemovePlayerPacket;
use PocketMine\Network\Protocol\SetEntityMotionPacket; use PocketMine\Network\Protocol\SetEntityMotionPacket;
use PocketMine\Network;
use PocketMine\Player; use PocketMine\Player;
use PocketMine\Server; use PocketMine\Server;

View File

@ -67,6 +67,7 @@ abstract class Event{
if(static::$handlerList === null){ if(static::$handlerList === null){
static::$handlerList = new HandlerList(); static::$handlerList = new HandlerList();
} }
return static::$handlerList; return static::$handlerList;
} }

View File

@ -86,6 +86,7 @@ class HandlerList{
} }
if(isset($this->handlerSlots[$listener->getPriority()][spl_object_hash($listener)])){ if(isset($this->handlerSlots[$listener->getPriority()][spl_object_hash($listener)])){
trigger_error("This listener is already registered to priority " . $listener->getPriority(), E_USER_WARNING); trigger_error("This listener is already registered to priority " . $listener->getPriority(), E_USER_WARNING);
return; return;
} }
$this->handlers = null; $this->handlers = null;
@ -110,7 +111,8 @@ class HandlerList{
foreach($this->handlerSlots as $priority => $list){ foreach($this->handlerSlots as $priority => $list){
foreach($list as $hash => $listener){ foreach($list as $hash => $listener){
if(($object instanceof Plugin and $listener->getPlugin() === $object) if(($object instanceof Plugin and $listener->getPlugin() === $object)
or ($object instanceof Listener and $listener->getListener() === $object)){ or ($object instanceof Listener and $listener->getListener() === $object)
){
unset($this->handlerSlots[$priority][$hash]); unset($this->handlerSlots[$priority][$hash]);
$changed = true; $changed = true;
} }
@ -153,11 +155,13 @@ class HandlerList{
$listeners[$hash] = $plugin; $listeners[$hash] = $plugin;
} }
} }
return $listeners; return $listeners;
}else{ }else{
while(($handlers = $this->handlers) === null){ while(($handlers = $this->handlers) === null){
$this->bake(); $this->bake();
} }
return $handlers; return $handlers;
} }
} }

View File

@ -21,8 +21,8 @@
namespace PocketMine\Event\Player; namespace PocketMine\Event\Player;
use PocketMine\Event;
use PocketMine\Event\Cancellable; use PocketMine\Event\Cancellable;
use PocketMine\Event;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\Player; use PocketMine\Player;

View File

@ -21,8 +21,8 @@
namespace PocketMine\Event\Server; namespace PocketMine\Event\Server;
use PocketMine\Event\Cancellable;
use PocketMine\Event; use PocketMine\Event;
use PocketMine\Event\Cancellable;
use PocketMine\Network\Protocol\DataPacket; use PocketMine\Network\Protocol\DataPacket;
use PocketMine\Player; use PocketMine\Player;

View File

@ -21,8 +21,8 @@
namespace PocketMine\Event\Server; namespace PocketMine\Event\Server;
use PocketMine\Event\Cancellable;
use PocketMine\Event; use PocketMine\Event;
use PocketMine\Event\Cancellable;
use PocketMine\Network\Protocol\DataPacket; use PocketMine\Network\Protocol\DataPacket;
use PocketMine\Player; use PocketMine\Player;

View File

@ -21,8 +21,8 @@
namespace PocketMine\Event\Tile; namespace PocketMine\Event\Tile;
use PocketMine\Event\Cancellable;
use PocketMine\Event; use PocketMine\Event;
use PocketMine\Event\Cancellable;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\Tile\Tile; use PocketMine\Tile\Tile;

View File

@ -25,7 +25,6 @@ use PocketMine\Block\Block;
use PocketMine\Block\TNT; use PocketMine\Block\TNT;
use PocketMine\Entity\Entity; use PocketMine\Entity\Entity;
use PocketMine\Event\Entity\EntityExplodeEvent; use PocketMine\Event\Entity\EntityExplodeEvent;
use PocketMine\Event\Event;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\Math\Vector3 as Vector3; use PocketMine\Math\Vector3 as Vector3;
use PocketMine\Network\Protocol\ExplodePacket; use PocketMine\Network\Protocol\ExplodePacket;

View File

@ -26,9 +26,9 @@ namespace PocketMine\Level;
use PocketMine\Block\Air; use PocketMine\Block\Air;
use PocketMine\Block\Block; use PocketMine\Block\Block;
use PocketMine\Entity\Entity;
use PocketMine\Event\Block\BlockBreakEvent; use PocketMine\Event\Block\BlockBreakEvent;
use PocketMine\Event\Block\BlockPlaceEvent; use PocketMine\Event\Block\BlockPlaceEvent;
use PocketMine\Event\Event;
use PocketMine\Event\Player\PlayerInteractEvent; use PocketMine\Event\Player\PlayerInteractEvent;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\Level\Generator\Flat; use PocketMine\Level\Generator\Flat;
@ -51,7 +51,6 @@ use PocketMine\Tile\Chest;
use PocketMine\Tile\Furnace; use PocketMine\Tile\Furnace;
use PocketMine\Tile\Sign; use PocketMine\Tile\Sign;
use PocketMine\Tile\Tile; use PocketMine\Tile\Tile;
use PocketMine\Entity\Entity;
use PocketMine\Utils\Cache; use PocketMine\Utils\Cache;
use PocketMine\Utils\Config; use PocketMine\Utils\Config;
use PocketMine\Utils\Random; use PocketMine\Utils\Random;
@ -124,6 +123,7 @@ class Level{
$default = Server::getInstance()->getConfigString("level-name", null); $default = Server::getInstance()->getConfigString("level-name", null);
if($default == ""){ if($default == ""){
trigger_error("level-name cannot be null", E_USER_ERROR); trigger_error("level-name cannot be null", E_USER_ERROR);
return; return;
} }
if(self::loadLevel($default) === false){ if(self::loadLevel($default) === false){

View File

@ -25,7 +25,6 @@
namespace PocketMine\Level\Generator\Noise; namespace PocketMine\Level\Generator\Noise;
abstract class Generator{ abstract class Generator{
protected $perm = array(); protected $perm = array();
protected $offsetX = 0; protected $offsetX = 0;

View File

@ -25,7 +25,6 @@
namespace PocketMine\Network\Protocol; namespace PocketMine\Network\Protocol;
abstract class Info{ abstract class Info{
/** /**

View File

@ -35,9 +35,11 @@ abstract class DefaultPermissions{
public static function registerPermission(Permission $perm, Permission $parent = null){ public static function registerPermission(Permission $perm, Permission $parent = null){
if($parent instanceof Permission){ if($parent instanceof Permission){
$parent->getChildren()[$perm->getName()] = true; $parent->getChildren()[$perm->getName()] = true;
return self::registerPermission($perm); return self::registerPermission($perm);
} }
Server::getInstance()->getPluginManager()->addPermission($perm); Server::getInstance()->getPluginManager()->addPermission($perm);
return Server::getInstance()->getPluginManager()->getPermission($perm->getName()); return Server::getInstance()->getPluginManager()->getPermission($perm->getName());
} }

View File

@ -21,8 +21,8 @@
namespace PocketMine\Permission; namespace PocketMine\Permission;
use PocketMine\Server;
use PocketMine\Plugin\Plugin; use PocketMine\Plugin\Plugin;
use PocketMine\Server;
class PermissibleBase implements Permissible{ class PermissibleBase implements Permissible{
/** /**
@ -74,6 +74,7 @@ class PermissibleBase implements Permissible{
public function setOp($value){ public function setOp($value){
if($this->opable === null){ if($this->opable === null){
trigger_error("Cannot change ip value as no ServerOperator is set", E_USER_WARNING); trigger_error("Cannot change ip value as no ServerOperator is set", E_USER_WARNING);
return; return;
}else{ }else{
$this->opable->setOp($value); $this->opable->setOp($value);
@ -105,6 +106,7 @@ class PermissibleBase implements Permissible{
if(($perm = Server::getInstance()->getPluginManager()->getPermission($name)) !== null){ if(($perm = Server::getInstance()->getPluginManager()->getPermission($name)) !== null){
$perm = $perm->getDefault(); $perm = $perm->getDefault();
return $perm === Permission::DEFAULT_TRUE or ($this->isOp() and $perm === Permission::DEFAULT_OP) or (!$this->isOp() and $perm === Permission::DEFAULT_NOT_OP); return $perm === Permission::DEFAULT_TRUE or ($this->isOp() and $perm === Permission::DEFAULT_OP) or (!$this->isOp() and $perm === Permission::DEFAULT_NOT_OP);
}else{ }else{
return Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_TRUE or ($this->isOp() and Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_OP) or (!$this->isOp() and Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_NOT_OP); return Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_TRUE or ($this->isOp() and Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_OP) or (!$this->isOp() and Permission::$DEFAULT_PERMISSION === Permission::DEFAULT_NOT_OP);
@ -124,9 +126,11 @@ class PermissibleBase implements Permissible{
public function addAttachment(Plugin $plugin, $name = null, $value = null){ public function addAttachment(Plugin $plugin, $name = null, $value = null){
if($plugin === null){ if($plugin === null){
trigger_error("Plugin cannot be null", E_USER_WARNING); trigger_error("Plugin cannot be null", E_USER_WARNING);
return null; return null;
}elseif(!$plugin->isEnabled()){ }elseif(!$plugin->isEnabled()){
trigger_error("Plugin " . $plugin->getDescription()->getName() . " is disabled", E_USER_WARNING); trigger_error("Plugin " . $plugin->getDescription()->getName() . " is disabled", E_USER_WARNING);
return null; return null;
} }
@ -149,6 +153,7 @@ class PermissibleBase implements Permissible{
public function removeAttachment(PermissionAttachment $attachment){ public function removeAttachment(PermissionAttachment $attachment){
if($attachment === null){ if($attachment === null){
trigger_error("Attachment cannot be null", E_USER_WARNING); trigger_error("Attachment cannot be null", E_USER_WARNING);
return; return;
} }

View File

@ -181,6 +181,7 @@ class Permission{
} }
$this->addParent($perm, $value); $this->addParent($perm, $value);
return $perm; return $perm;
} }
} }

View File

@ -51,6 +51,7 @@ class PermissionAttachment{
public function __construct(Plugin $plugin, Permissible $permissible){ public function __construct(Plugin $plugin, Permissible $permissible){
if(!$plugin->isEnabled()){ if(!$plugin->isEnabled()){
trigger_error("Plugin " . $plugin->getDescription()->getName() . " is disabled", E_USER_WARNING); trigger_error("Plugin " . $plugin->getDescription()->getName() . " is disabled", E_USER_WARNING);
return; return;
} }

View File

@ -52,6 +52,7 @@ class PermissionAttachmentInfo{
public function __construct(Permissible $permissible, $permission, $attachment, $value){ public function __construct(Permissible $permissible, $permission, $attachment, $value){
if($permission === null){ if($permission === null){
trigger_error("Permission may not be null", E_USER_WARNING); trigger_error("Permission may not be null", E_USER_WARNING);
return; return;
} }

View File

@ -56,11 +56,11 @@ class FolderPluginLoader implements PluginLoader{
$dataFolder = basename($file) . "/" . $description->getName(); $dataFolder = basename($file) . "/" . $description->getName();
if(file_exists($dataFolder) and !is_dir($dataFolder)){ if(file_exists($dataFolder) and !is_dir($dataFolder)){
trigger_error("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory", E_USER_WARNING); trigger_error("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory", E_USER_WARNING);
return null; return null;
} }
$className = $description->getMain(); $className = $description->getMain();
$this->server->getLoader()->add(substr($className, 0, strpos($className, "\\")), array( $this->server->getLoader()->add(substr($className, 0, strpos($className, "\\")), array(
$file . "/src" $file . "/src"
@ -69,13 +69,16 @@ class FolderPluginLoader implements PluginLoader{
if(class_exists($className, true)){ if(class_exists($className, true)){
$plugin = new $className(); $plugin = new $className();
$this->initPlugin($plugin, $description, $dataFolder, $file); $this->initPlugin($plugin, $description, $dataFolder, $file);
return $plugin; return $plugin;
}else{ }else{
trigger_error("Couldn't load plugin " . $description->getName() . ": main class not found", E_USER_WARNING); trigger_error("Couldn't load plugin " . $description->getName() . ": main class not found", E_USER_WARNING);
return null; return null;
} }
} }
} }
return null; return null;
} }
@ -93,6 +96,7 @@ class FolderPluginLoader implements PluginLoader{
return new PluginDescription($yaml); return new PluginDescription($yaml);
} }
} }
return null; return null;
} }

View File

@ -20,7 +20,6 @@
*/ */
namespace PocketMine\Plugin; namespace PocketMine\Plugin;
use PocketMine\Event\Listener;
/** /**
* Handles different types of plugins * Handles different types of plugins

View File

@ -22,14 +22,13 @@
namespace PocketMine\Plugin; namespace PocketMine\Plugin;
use PocketMine\Command\PluginCommand; use PocketMine\Command\PluginCommand;
use PocketMine\Event\Cancellable; use PocketMine\Command\SimpleCommandMap;
use PocketMine\Event\Event; use PocketMine\Event\Event;
use PocketMine\Event\HandlerList;
use PocketMine\Event\Listener; use PocketMine\Event\Listener;
use PocketMine\Permission\Permissible; use PocketMine\Permission\Permissible;
use PocketMine\Permission\Permission; use PocketMine\Permission\Permission;
use PocketMine\Server; use PocketMine\Server;
use PocketMine\Command\SimpleCommandMap;
use PocketMine\Event\HandlerList;
/** /**
* Manages all the plugins, Permissions and Permissibles * Manages all the plugins, Permissions and Permissibles
@ -156,6 +155,7 @@ class PluginManager{
if($description instanceof PluginDescription){ if($description instanceof PluginDescription){
if(($plugin = $loader->loadPlugin($path)) instanceof Plugin){ if(($plugin = $loader->loadPlugin($path)) instanceof Plugin){
$this->plugins[$plugin->getDescription()->getName()] = $plugin; $this->plugins[$plugin->getDescription()->getName()] = $plugin;
return $plugin; return $plugin;
} }
} }
@ -555,6 +555,7 @@ class PluginManager{
$pluginCmds[] = $newCmd; $pluginCmds[] = $newCmd;
} }
return $pluginCmds; return $pluginCmds;
} }
} }
@ -617,10 +618,12 @@ class PluginManager{
public function registerEvent($event, Listener $listener, $priority, EventExecutor $executor, Plugin $plugin, $ignoreCancelled = false){ public function registerEvent($event, Listener $listener, $priority, EventExecutor $executor, Plugin $plugin, $ignoreCancelled = false){
if(!is_subclass_of($event, "PocketMine\\Event\\Event")){ if(!is_subclass_of($event, "PocketMine\\Event\\Event")){
trigger_error($event . " is not a valid Event", E_USER_WARNING); trigger_error($event . " is not a valid Event", E_USER_WARNING);
return; return;
} }
if(!$plugin->isEnabled()){ if(!$plugin->isEnabled()){
trigger_error("Plugin attempted to register " . $event . " while not enabled"); trigger_error("Plugin attempted to register " . $event . " while not enabled");
return; return;
} }
@ -636,6 +639,7 @@ class PluginManager{
if($event::$handlerList === null){ if($event::$handlerList === null){
$event::$handlerList = new HandlerList(); $event::$handlerList = new HandlerList();
} }
return $event::$handlerList; return $event::$handlerList;
} }

View File

@ -25,7 +25,6 @@
namespace PocketMine\Recipes; namespace PocketMine\Recipes;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\Server;
abstract class Crafting{ abstract class Crafting{

View File

@ -133,6 +133,7 @@ class ServerScheduler{
private function addTask(Task $task, $delay, $period){ private function addTask(Task $task, $delay, $period){
if($task instanceof PluginTask and !$task->getOwner()->isEnabled()){ if($task instanceof PluginTask and !$task->getOwner()->isEnabled()){
trigger_error("Plugin attempted to register a task while disabled", E_USER_WARNING); trigger_error("Plugin attempted to register a task while disabled", E_USER_WARNING);
return null; return null;
} }

View File

@ -42,6 +42,7 @@ abstract class Task{
if($this->taskHandler !== null){ if($this->taskHandler !== null){
return $this->taskHandler->getTaskId(); return $this->taskHandler->getTaskId();
} }
return -1; return -1;
} }

View File

@ -43,6 +43,7 @@ class TickScheduler extends \Thread{
return $this->synchronized(function (){ return $this->synchronized(function (){
$hasTick = $this->hasTick; $hasTick = $this->hasTick;
$this->hasTick = false; $this->hasTick = false;
return $hasTick === true; return $hasTick === true;
}); });
} }

View File

@ -21,7 +21,6 @@
namespace PocketMine\Tile; namespace PocketMine\Tile;
use PocketMine\Event\Event;
use PocketMine\Event\Tile\TileInventoryChangeEvent; use PocketMine\Event\Tile\TileInventoryChangeEvent;
use PocketMine\Item\Item; use PocketMine\Item\Item;
use PocketMine\NBT\Tag\Byte; use PocketMine\NBT\Tag\Byte;

View File

@ -707,6 +707,7 @@ class Utils{
if($unpacked > 2147483647){ if($unpacked > 2147483647){
$unpacked -= 4294967296; $unpacked -= 4294967296;
} }
return (int) $unpacked; return (int) $unpacked;
} }
@ -719,6 +720,7 @@ class Utils{
if($unpacked >= 2147483648){ if($unpacked >= 2147483648){
$unpacked -= 4294967296; $unpacked -= 4294967296;
} }
return (int) $unpacked; return (int) $unpacked;
} }

View File

@ -5,8 +5,7 @@
* *
* @author Guilherme Blanco <guilhermeblanco@php.net> * @author Guilherme Blanco <guilhermeblanco@php.net>
*/ */
interface SplAutoloader interface SplAutoloader{
{
/** /**
* Defines autoloader to work silently if resource is not found. * Defines autoloader to work silently if resource is not found.
* *

View File

@ -42,8 +42,7 @@ require_once("SplAutoLoader.php");
* @author Kris Wallsmith <kris.wallsmith@gmail.com> * @author Kris Wallsmith <kris.wallsmith@gmail.com>
* @author Fabien Potencier <fabien.potencier@symfony-project.org> * @author Fabien Potencier <fabien.potencier@symfony-project.org>
*/ */
class SplClassLoader implements SplAutoloader class SplClassLoader implements SplAutoloader{
{
/** /**
* @var string * @var string
*/ */
@ -67,8 +66,7 @@ class SplClassLoader implements SplAutoloader
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setMode($mode) public function setMode($mode){
{
if($mode & self::MODE_SILENT && $mode & self::MODE_NORMAL){ if($mode & self::MODE_SILENT && $mode & self::MODE_NORMAL){
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
sprintf('Cannot have %s working normally and silently at the same time!', __CLASS__) sprintf('Cannot have %s working normally and silently at the same time!', __CLASS__)
@ -83,8 +81,7 @@ class SplClassLoader implements SplAutoloader
* *
* @param string $fileExtension * @param string $fileExtension
*/ */
public function setFileExtension($fileExtension) public function setFileExtension($fileExtension){
{
$this->fileExtension = $fileExtension; $this->fileExtension = $fileExtension;
} }
@ -93,8 +90,7 @@ class SplClassLoader implements SplAutoloader
* *
* @return string * @return string
*/ */
public function getFileExtension() public function getFileExtension(){
{
return $this->fileExtension; return $this->fileExtension;
} }
@ -103,8 +99,7 @@ class SplClassLoader implements SplAutoloader
* *
* @param boolean $includePathLookup * @param boolean $includePathLookup
*/ */
public function setIncludePathLookup($includePathLookup) public function setIncludePathLookup($includePathLookup){
{
$this->includePathLookup = $includePathLookup; $this->includePathLookup = $includePathLookup;
} }
@ -113,40 +108,35 @@ class SplClassLoader implements SplAutoloader
* *
* @return boolean * @return boolean
*/ */
public function getIncludePathLookup() public function getIncludePathLookup(){
{
return $this->includePathLookup; return $this->includePathLookup;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function register($prepend = false) public function register($prepend = false){
{
spl_autoload_register(array($this, 'load'), true, $prepend); spl_autoload_register(array($this, 'load'), true, $prepend);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unregister() public function unregister(){
{
spl_autoload_unregister(array($this, 'load')); spl_autoload_unregister(array($this, 'load'));
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add($resource, $resourcePath = null) public function add($resource, $resourcePath = null){
{
$this->resources[$resource] = (array) $resourcePath; $this->resources[$resource] = (array) $resourcePath;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function load($resourceName) public function load($resourceName){
{
$resourceAbsolutePath = $this->getResourceAbsolutePath($resourceName); $resourceAbsolutePath = $this->getResourceAbsolutePath($resourceName);
switch(true){ switch(true){
@ -176,8 +166,7 @@ class SplClassLoader implements SplAutoloader
* *
* @return string Resource absolute path. * @return string Resource absolute path.
*/ */
private function getResourceAbsolutePath($resourceName) private function getResourceAbsolutePath($resourceName){
{
$resourceRelativePath = $this->getResourceRelativePath($resourceName); $resourceRelativePath = $this->getResourceRelativePath($resourceName);
foreach($this->resources as $resource => $resourcesPath){ foreach($this->resources as $resource => $resourcesPath){
@ -208,8 +197,7 @@ class SplClassLoader implements SplAutoloader
* *
* @return string Resource relative path. * @return string Resource relative path.
*/ */
private function getResourceRelativePath($resourceName) private function getResourceRelativePath($resourceName){
{
// We always work with FQCN in this context // We always work with FQCN in this context
$resourceName = ltrim($resourceName, '\\'); $resourceName = ltrim($resourceName, '\\');
$resourcePath = ''; $resourcePath = '';
@ -231,8 +219,7 @@ class SplClassLoader implements SplAutoloader
* *
* @return boolean * @return boolean
*/ */
private function isResourceDeclared($resourceName) private function isResourceDeclared($resourceName){
{
return class_exists($resourceName, false) return class_exists($resourceName, false)
|| interface_exists($resourceName, false) || interface_exists($resourceName, false)
|| (function_exists('trait_exists') && trait_exists($resourceName, false)); || (function_exists('trait_exists') && trait_exists($resourceName, false));

View File

@ -71,8 +71,7 @@ define('PTHREADS_ALLOW_GLOBALS', 0x10000000);
* @link http://www.php.net/manual/en/class.threaded.php * @link http://www.php.net/manual/en/class.threaded.php
* @since 2.0.0 * @since 2.0.0
*/ */
class Threaded implements Traversable, Countable, ArrayAccess class Threaded implements Traversable, Countable, ArrayAccess{
{
/** /**
* Fetches a chunk of the objects properties table of the given size * Fetches a chunk of the objects properties table of the given size
* *
@ -81,12 +80,14 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.chunk.php * @link http://www.php.net/manual/en/threaded.chunk.php
* @return array An array of items from the objects member table * @return array An array of items from the objects member table
*/ */
public function chunk($size) {} public function chunk($size){
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function count() {} public function count(){
}
/** /**
* Retrieves terminal error information from the referenced object * Retrieves terminal error information from the referenced object
@ -94,7 +95,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.getterminationinfo.php * @link http://www.php.net/manual/en/threaded.getterminationinfo.php
* @return array|bool array containing the termination conditions of the referenced object * @return array|bool array containing the termination conditions of the referenced object
*/ */
public function getTerminationInfo() {} public function getTerminationInfo(){
}
/** /**
* Tell if the referenced object is executing * Tell if the referenced object is executing
@ -102,7 +104,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.isrunning.php * @link http://www.php.net/manual/en/threaded.isrunning.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isRunning() {} public function isRunning(){
}
/** /**
* Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution * Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution
@ -110,7 +113,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.isterminated.php * @link http://www.php.net/manual/en/threaded.isterminated.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isTerminated() {} public function isTerminated(){
}
/** /**
* Tell if the referenced object is waiting for notification * Tell if the referenced object is waiting for notification
@ -118,7 +122,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.iswaiting.php * @link http://www.php.net/manual/en/threaded.iswaiting.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isWaiting() {} public function isWaiting(){
}
/** /**
* Lock the referenced objects property table * Lock the referenced objects property table
@ -126,7 +131,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.lock.php * @link http://www.php.net/manual/en/threaded.lock.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function lock() {} public function lock(){
}
/** /**
* Merges data into the current object * Merges data into the current object
@ -137,7 +143,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.merge.php * @link http://www.php.net/manual/en/threaded.merge.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function merge($from, $overwrite = true) {} public function merge($from, $overwrite = true){
}
/** /**
* Send notification to the referenced object * Send notification to the referenced object
@ -145,27 +152,32 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.notify.php * @link http://www.php.net/manual/en/threaded.notify.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function notify() {} public function notify(){
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetGet($offset) {} public function offsetGet($offset){
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetSet($offset, $value) {} public function offsetSet($offset, $value){
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetExists($offset) {} public function offsetExists($offset){
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetUnset($offset) {} public function offsetUnset($offset){
}
/** /**
* Pops an item from the objects property table * Pops an item from the objects property table
@ -173,7 +185,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.pop.php * @link http://www.php.net/manual/en/threaded.pop.php
* @return mixed The last item from the objects properties table * @return mixed The last item from the objects properties table
*/ */
public function pop() {} public function pop(){
}
/** /**
* The programmer should always implement the run method for objects that are intended for execution. * The programmer should always implement the run method for objects that are intended for execution.
@ -181,7 +194,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.run.php * @link http://www.php.net/manual/en/threaded.run.php
* @return void The methods return value, if used, will be ignored * @return void The methods return value, if used, will be ignored
*/ */
public function run() {} public function run(){
}
/** /**
* Shifts an item from the objects properties table * Shifts an item from the objects properties table
@ -189,7 +203,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.shift.php * @link http://www.php.net/manual/en/threaded.shift.php
* @return mixed The first item from the objects properties table * @return mixed The first item from the objects properties table
*/ */
public function shift() {} public function shift(){
}
/** /**
* Executes the block while retaining the synchronization lock for the current context. * Executes the block while retaining the synchronization lock for the current context.
@ -200,7 +215,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.synchronized.php * @link http://www.php.net/manual/en/threaded.synchronized.php
* @return mixed The return value from the block * @return mixed The return value from the block
*/ */
public function synchronized(\Closure $function, $args = null) {} public function synchronized(\Closure $function, $args = null){
}
/** /**
* Unlock the referenced objects storage for the calling context * Unlock the referenced objects storage for the calling context
@ -208,7 +224,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.unlock.php * @link http://www.php.net/manual/en/threaded.unlock.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function unlock() {} public function unlock(){
}
/** /**
* Waits for notification from the Stackable * Waits for notification from the Stackable
@ -218,7 +235,8 @@ class Threaded implements Traversable, Countable, ArrayAccess
* @link http://www.php.net/manual/en/threaded.wait.php * @link http://www.php.net/manual/en/threaded.wait.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function wait($timeout) {} public function wait($timeout){
}
} }
/** /**
@ -229,15 +247,15 @@ class Threaded implements Traversable, Countable, ArrayAccess
* *
* @link http://www.php.net/manual/en/class.thread.php * @link http://www.php.net/manual/en/class.thread.php
*/ */
class Thread extends Threaded class Thread extends Threaded{
{
/** /**
* Detaches a thread * Detaches a thread
* *
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function detach() {} public function detach(){
}
/** /**
* Will return the identity of the Thread that created the referenced Thread * Will return the identity of the Thread that created the referenced Thread
@ -245,14 +263,16 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.getcreatorid.php * @link http://www.php.net/manual/en/thread.getcreatorid.php
* @return int A numeric identity * @return int A numeric identity
*/ */
public function getCreatorId() {} public function getCreatorId(){
}
/** /**
* Will return the instance of currently executing thread * Will return the instance of currently executing thread
* *
* @return static * @return static
*/ */
public static function getCurrentThread() {} public static function getCurrentThread(){
}
/** /**
* Will return the identity of the currently executing thread * Will return the identity of the currently executing thread
@ -260,7 +280,8 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.getcurrentthreadid.php * @link http://www.php.net/manual/en/thread.getcurrentthreadid.php
* @return int * @return int
*/ */
public static function getCurrentThreadId() {} public static function getCurrentThreadId(){
}
/** /**
* Will return the identity of the referenced Thread * Will return the identity of the referenced Thread
@ -268,7 +289,8 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.getthreadid.php * @link http://www.php.net/manual/en/thread.getthreadid.php
* @return int * @return int
*/ */
public function getThreadId() {} public function getThreadId(){
}
/** /**
* Tell if the referenced Thread has been joined by another context * Tell if the referenced Thread has been joined by another context
@ -276,7 +298,8 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.isjoined.php * @link http://www.php.net/manual/en/thread.isjoined.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isJoined() {} public function isJoined(){
}
/** /**
* Tell if the referenced Thread has been started * Tell if the referenced Thread has been started
@ -284,7 +307,8 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.isstarted.php * @link http://www.php.net/manual/en/thread.isstarted.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isStarted() {} public function isStarted(){
}
/** /**
* Causes the calling context to wait for the referenced Thread to finish executing * Causes the calling context to wait for the referenced Thread to finish executing
@ -292,14 +316,16 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.join.php * @link http://www.php.net/manual/en/thread.join.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function join() {} public function join(){
}
/** /**
* Kills the referenced thread, dangerously ! * Kills the referenced thread, dangerously !
* *
* @link http://www.php.net/manual/en/thread.kill.php * @link http://www.php.net/manual/en/thread.kill.php
*/ */
public function kill() {} public function kill(){
}
/** /**
* Will start a new Thread to execute the implemented run method * Will start a new Thread to execute the implemented run method
@ -309,17 +335,20 @@ class Thread extends Threaded
* @link http://www.php.net/manual/en/thread.start.php * @link http://www.php.net/manual/en/thread.start.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function start($options = PTHREADS_INHERIT_ALL) {} public function start($options = PTHREADS_INHERIT_ALL){
}
/** /**
* Will execute the Callable in the global scope * Will execute the Callable in the global scope
* *
* @param Callable $block The code to execute * @param Callable $block The code to execute
* @param ... $args Variable length list of arguments to pass to the Callable upon execution * @param ... $args Variable length list of arguments to pass to the Callable upon execution
*
* @link http://www.php.net/manual/en/thread.start.php * @link http://www.php.net/manual/en/thread.start.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public static function globally(Callable $block, $args = null){} public static function globally(Callable $block, $args = null){
}
} }
/** /**
@ -337,8 +366,7 @@ class Thread extends Threaded
* *
* @link http://www.php.net/manual/en/class.worker.php * @link http://www.php.net/manual/en/class.worker.php
*/ */
class Worker extends Thread class Worker extends Thread{
{
/** /**
* Returns the number of threaded tasks waiting to be executed by the referenced Worker * Returns the number of threaded tasks waiting to be executed by the referenced Worker
@ -346,7 +374,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.getstacked.php * @link http://www.php.net/manual/en/worker.getstacked.php
* @return int An integral value * @return int An integral value
*/ */
public function getStacked() {} public function getStacked(){
}
/** /**
* Tell if the referenced Worker has been shutdown * Tell if the referenced Worker has been shutdown
@ -354,7 +383,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.isshutdown.php * @link http://www.php.net/manual/en/worker.isshutdown.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isShutdown() {} public function isShutdown(){
}
/** /**
* Tell if a Worker is executing threaded tasks * Tell if a Worker is executing threaded tasks
@ -362,7 +392,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.isworking.php * @link http://www.php.net/manual/en/worker.isworking.php
* @return bool A boolean indication of state * @return bool A boolean indication of state
*/ */
public function isWorking() {} public function isWorking(){
}
/** /**
* Shuts down the Worker after executing all the threaded tasks previously stacked * Shuts down the Worker after executing all the threaded tasks previously stacked
@ -370,7 +401,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.shutdown.php * @link http://www.php.net/manual/en/worker.shutdown.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
public function shutdown() {} public function shutdown(){
}
/** /**
* Appends the referenced object to the stack of the referenced Worker * Appends the referenced object to the stack of the referenced Worker
@ -380,7 +412,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.stack.php * @link http://www.php.net/manual/en/worker.stack.php
* @return int The new length of the stack * @return int The new length of the stack
*/ */
public function stack(Threaded &$work) {} public function stack(Threaded &$work){
}
/** /**
* Removes the referenced object ( or all objects if parameter is null ) from stack of the referenced Worker * Removes the referenced object ( or all objects if parameter is null ) from stack of the referenced Worker
@ -390,7 +423,8 @@ class Worker extends Thread
* @link http://www.php.net/manual/en/worker.unstack.php * @link http://www.php.net/manual/en/worker.unstack.php
* @return int The new length of the stack * @return int The new length of the stack
*/ */
public function unstack(Threaded &$work = null) {} public function unstack(Threaded &$work = null){
}
} }
/** /**
@ -400,8 +434,7 @@ class Worker extends Thread
* *
* @link http://www.php.net/manual/en/class.mutex.php * @link http://www.php.net/manual/en/class.mutex.php
*/ */
class Mutex class Mutex{
{
/** /**
* Create, and optionally lock a new Mutex for the caller * Create, and optionally lock a new Mutex for the caller
@ -411,7 +444,8 @@ class Mutex
* @link http://www.php.net/manual/en/mutex.create.php * @link http://www.php.net/manual/en/mutex.create.php
* @return int A newly created and optionally locked Mutex handle * @return int A newly created and optionally locked Mutex handle
*/ */
final public static function create($lock = false) {} final public static function create($lock = false){
}
/** /**
* Destroy mutex * Destroy mutex
@ -424,7 +458,8 @@ class Mutex
* @link http://www.php.net/manual/en/mutex.destroy.php * @link http://www.php.net/manual/en/mutex.destroy.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function destroy($mutex) {} final public static function destroy($mutex){
}
/** /**
* Attempt to lock the Mutex for the caller. * Attempt to lock the Mutex for the caller.
@ -436,7 +471,8 @@ class Mutex
* @link http://www.php.net/manual/en/mutex.lock.php * @link http://www.php.net/manual/en/mutex.lock.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function lock($mutex) {} final public static function lock($mutex){
}
/** /**
* Attempt to lock the Mutex for the caller without blocking if the Mutex is owned (locked) by another Thread. * Attempt to lock the Mutex for the caller without blocking if the Mutex is owned (locked) by another Thread.
@ -446,7 +482,8 @@ class Mutex
* @link http://www.php.net/manual/en/mutex.trylock.php * @link http://www.php.net/manual/en/mutex.trylock.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function trylock($mutex) {} final public static function trylock($mutex){
}
/** /**
* Release mutex * Release mutex
@ -460,7 +497,8 @@ class Mutex
* @link http://www.php.net/manual/en/mutex.unlock.php * @link http://www.php.net/manual/en/mutex.unlock.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function unlock($mutex, $destroy = false) {} final public static function unlock($mutex, $destroy = false){
}
} }
/** /**
@ -470,8 +508,7 @@ class Mutex
* *
* @link http://www.php.net/manual/en/class.cond.php * @link http://www.php.net/manual/en/class.cond.php
*/ */
class Cond class Cond{
{
/** /**
* Broadcast to all Threads blocking on a call to Cond::wait(). * Broadcast to all Threads blocking on a call to Cond::wait().
* *
@ -480,7 +517,8 @@ class Cond
* @link http://www.php.net/manual/en/cond.broadcast.php * @link http://www.php.net/manual/en/cond.broadcast.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function broadcast($condition) {} final public static function broadcast($condition){
}
/** /**
* Creates a new Condition Variable for the caller. * Creates a new Condition Variable for the caller.
@ -488,7 +526,8 @@ class Cond
* @link http://www.php.net/manual/en/cond.create.php * @link http://www.php.net/manual/en/cond.create.php
* @return int A handle to a Condition Variable * @return int A handle to a Condition Variable
*/ */
final public static function create() {} final public static function create(){
}
/** /**
* Destroy a condition * Destroy a condition
@ -502,7 +541,8 @@ class Cond
* @link http://www.php.net/manual/en/cond.destroy.php * @link http://www.php.net/manual/en/cond.destroy.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function destroy($condition) {} final public static function destroy($condition){
}
/** /**
* Signal a Condition * Signal a Condition
@ -512,7 +552,8 @@ class Cond
* @link http://www.php.net/manual/en/cond.signal.php * @link http://www.php.net/manual/en/cond.signal.php
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function signal($condition) {} final public static function signal($condition){
}
/** /**
* Wait for a signal on a Condition Variable, optionally specifying a timeout to limit waiting time. * Wait for a signal on a Condition Variable, optionally specifying a timeout to limit waiting time.
@ -523,7 +564,8 @@ class Cond
* *
* @return bool A boolean indication of success * @return bool A boolean indication of success
*/ */
final public static function wait($condition, $mutex, $timeout = null) {} final public static function wait($condition, $mutex, $timeout = null){
}
} }
/** /**
@ -535,8 +577,7 @@ class Cond
* *
* @link http://www.php.net/manual/en/class.pool.php * @link http://www.php.net/manual/en/class.pool.php
*/ */
class Pool class Pool{
{
/** /**
* The maximum number of Worker threads allowed in this Pool * The maximum number of Worker threads allowed in this Pool
* *
@ -588,14 +629,16 @@ class Pool
* *
* @link http://www.php.net/manual/en/pool.__construct.php * @link http://www.php.net/manual/en/pool.__construct.php
*/ */
public function __construct($size, $class, array $ctor = array()) {} public function __construct($size, $class, array $ctor = array()){
}
/** /**
* Shuts down all Workers, and collect all Stackables, finally destroys the Pool * Shuts down all Workers, and collect all Stackables, finally destroys the Pool
* *
* @link http://www.php.net/manual/en/pool.__destruct.php * @link http://www.php.net/manual/en/pool.__destruct.php
*/ */
public function __destruct() {} public function __destruct(){
}
/** /**
* Collect references to completed tasks * Collect references to completed tasks
@ -606,7 +649,8 @@ class Pool
* *
* @link http://www.php.net/manual/en/pool.collect.php * @link http://www.php.net/manual/en/pool.collect.php
*/ */
public function collect(callable $collector) {} public function collect(callable $collector){
}
/** /**
* Resize the Pool * Resize the Pool
@ -615,14 +659,16 @@ class Pool
* *
* @link http://www.php.net/manual/en/pool.resize.php * @link http://www.php.net/manual/en/pool.resize.php
*/ */
public function resize($size) {} public function resize($size){
}
/** /**
* Shutdown all Workers in this Pool * Shutdown all Workers in this Pool
* *
* @link http://www.php.net/manual/en/pool.shutdown.php * @link http://www.php.net/manual/en/pool.shutdown.php
*/ */
public function shutdown() {} public function shutdown(){
}
/** /**
* Submit the task to the next Worker in the Pool * Submit the task to the next Worker in the Pool
@ -631,7 +677,8 @@ class Pool
* *
* @return int the identifier of the Worker executing the object * @return int the identifier of the Worker executing the object
*/ */
public function submit(Threaded $task) {} public function submit(Threaded $task){
}
/** /**
* Submit the task to the specific Worker in the Pool * Submit the task to the specific Worker in the Pool
@ -641,5 +688,6 @@ class Pool
* *
* @return int the identifier of the Worker that accepted the object * @return int the identifier of the Worker that accepted the object
*/ */
public function submitTo($worker, Threaded $task) {} public function submitTo($worker, Threaded $task){
}
} }

View File

@ -46,7 +46,8 @@ define("YAML_CRLN_BREAK", 3);
* @link http://www.php.net/manual/en/function.yaml-emit-file.php * @link http://www.php.net/manual/en/function.yaml-emit-file.php
* @return bool * @return bool
*/ */
function yaml_emit_file($filename, $data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_BREAK, array $callbacks = array()){} function yaml_emit_file($filename, $data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_BREAK, array $callbacks = array()){
}
/** /**
* Returns the YAML representation of a value * Returns the YAML representation of a value
@ -59,7 +60,8 @@ function yaml_emit_file($filename, $data, $encoding = YAML_ANY_ENCODING, $linebr
* @link http://www.php.net/manual/en/function.yaml-emit.php * @link http://www.php.net/manual/en/function.yaml-emit.php
* @return string * @return string
*/ */
function yaml_emit($data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_BREAK, array $callbacks = array()){} function yaml_emit($data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_BREAK, array $callbacks = array()){
}
/** /**
* Parse a YAML stream from a file * Parse a YAML stream from a file
@ -72,7 +74,8 @@ function yaml_emit($data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_B
* @link http://www.php.net/manual/en/function.yaml-parse-file.php * @link http://www.php.net/manual/en/function.yaml-parse-file.php
* @return mixed * @return mixed
*/ */
function yaml_parse_file($filename, $pos = 0, &$ndocs = null, array $callbacks = array()){} function yaml_parse_file($filename, $pos = 0, &$ndocs = null, array $callbacks = array()){
}
/** /**
* Parse a YAML stream from a URL * Parse a YAML stream from a URL
@ -85,7 +88,8 @@ function yaml_parse_file($filename, $pos = 0, &$ndocs = null, array $callbacks =
* @link http://www.php.net/manual/en/function.yaml-parse-url.php * @link http://www.php.net/manual/en/function.yaml-parse-url.php
* @return mixed * @return mixed
*/ */
function yaml_parse_url($url, $pos = 0, &$ndocs = null, array $callbacks = array()){} function yaml_parse_url($url, $pos = 0, &$ndocs = null, array $callbacks = array()){
}
/** /**
* Parse a YAML stream * Parse a YAML stream
@ -98,4 +102,5 @@ function yaml_parse_url($url, $pos = 0, &$ndocs = null, array $callbacks = array
* @link http://www.php.net/manual/en/function.yaml-parse.php * @link http://www.php.net/manual/en/function.yaml-parse.php
* @return mixed * @return mixed
*/ */
function yaml_parse($input, $pos = 0, &$ndocs = null, array $callbacks = array()){} function yaml_parse($input, $pos = 0, &$ndocs = null, array $callbacks = array()){
}