From 1b61f4bc6355bd3a179facf98bbb77ab6bbfdd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 24 May 2013 01:40:56 +0200 Subject: [PATCH] Fix PHPDoc --- .../system/command/commands/ColorCommand.class.php | 5 +++++ .../lib/system/command/commands/MeCommand.class.php | 3 +++ .../command/commands/RestoreCommand.class.php | 10 +++++++--- .../system/command/commands/UnmuteCommand.class.php | 3 +++ .../system/command/commands/WhereCommand.class.php | 2 -- .../command/commands/WhisperCommand.class.php | 13 +++++++------ install.sql | 2 +- package.xml | 2 +- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/file/lib/system/command/commands/ColorCommand.class.php b/file/lib/system/command/commands/ColorCommand.class.php index fc96f3f..06ec030 100644 --- a/file/lib/system/command/commands/ColorCommand.class.php +++ b/file/lib/system/command/commands/ColorCommand.class.php @@ -12,6 +12,11 @@ * @subpackage system.chat.command.commands */ class ColorCommand extends \chat\system\command\AbstractCommand { + /** + * Map names to hexcodes + * + * @var array + */ public static $colors = array( 'red' => 0xFF0000, 'blue' => 0x0000FF, diff --git a/file/lib/system/command/commands/MeCommand.class.php b/file/lib/system/command/commands/MeCommand.class.php index 9e259f0..9d90113 100644 --- a/file/lib/system/command/commands/MeCommand.class.php +++ b/file/lib/system/command/commands/MeCommand.class.php @@ -12,6 +12,9 @@ * @subpackage system.chat.command.commands */ class MeCommand extends \chat\system\command\AbstractCommand { + /** + * @see \chat\system\command\AbstractCommand::$enableSmilies + */ public $enableSmilies = self::SETTING_USER; public function __construct(\chat\system\command\CommandHandler $commandHandler) { diff --git a/file/lib/system/command/commands/RestoreCommand.class.php b/file/lib/system/command/commands/RestoreCommand.class.php index f49f061..92dba9b 100644 --- a/file/lib/system/command/commands/RestoreCommand.class.php +++ b/file/lib/system/command/commands/RestoreCommand.class.php @@ -21,10 +21,14 @@ class RestoreCommand extends \chat\system\command\AbstractRestrictedCommand { public function __construct(\chat\system\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); - $this->user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); - if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); + $username = rtrim($commandHandler->getParameters(), ','); + $this->user = User::getUserByUsername($username); + if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException($username); - $this->link = ''; + $profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array( + 'object' => $this->user + )); + $this->link = "[url='".$profile."']".$this->user->username.'[/url]'; $this->didInit(); } diff --git a/file/lib/system/command/commands/UnmuteCommand.class.php b/file/lib/system/command/commands/UnmuteCommand.class.php index 5054ebb..9019a87 100644 --- a/file/lib/system/command/commands/UnmuteCommand.class.php +++ b/file/lib/system/command/commands/UnmuteCommand.class.php @@ -36,6 +36,9 @@ public function __construct(\chat\system\command\CommandHandler $commandHandler) $this->didInit(); } + /** + * Removes the suspension. + */ public function executeAction() { if ($suspension = suspension\Suspension::getSuspensionByUserRoomAndType($this->user, $this->room, suspension\Suspension::TYPE_MUTE)) { $action = new suspension\SuspensionAction(array($suspension), 'delete'); diff --git a/file/lib/system/command/commands/WhereCommand.class.php b/file/lib/system/command/commands/WhereCommand.class.php index ad19333..eece31a 100644 --- a/file/lib/system/command/commands/WhereCommand.class.php +++ b/file/lib/system/command/commands/WhereCommand.class.php @@ -11,8 +11,6 @@ * @subpackage system.chat.command.commands */ class WhereCommand extends \chat\system\command\AbstractCommand { - public $enableHTML = self::SETTING_ON; - /** * @see \chat\system\command\ICommand::getType() */ diff --git a/file/lib/system/command/commands/WhisperCommand.class.php b/file/lib/system/command/commands/WhisperCommand.class.php index 0049c8c..53ec0c6 100644 --- a/file/lib/system/command/commands/WhisperCommand.class.php +++ b/file/lib/system/command/commands/WhisperCommand.class.php @@ -12,19 +12,20 @@ * @subpackage system.chat.command.commands */ class WhisperCommand extends \chat\system\command\AbstractCommand { + /** + * @see \chat\system\command\AbstractCommand::$enableSmilies + */ public $enableSmilies = self::SETTING_USER; public $user = null, $message = ''; public function __construct(\chat\system\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); - $parameters = $commandHandler->getParameters(); - - if (($comma = strpos($parameters, ',')) !== false) { - $username = substr($parameters, 0, $comma); - $this->message = substr($parameters, $comma + 1); + try { + list($username, $message) = explode(',', $commandHandler->getParameters(), 2); + $this->message = \wcf\util\StringUtil::trim($message); } - else { + catch (\wcf\system\exception\SystemException $e) { throw new \chat\system\command\NotFoundException(); } diff --git a/install.sql b/install.sql index 50ebf7e..0f83a1b 100644 --- a/install.sql +++ b/install.sql @@ -51,7 +51,7 @@ CREATE TABLE chat1_suspension ( UNIQUE KEY suspension (userID, roomID, type), KEY (roomID), KEY (type), - KEY (time) + KEY (expires) ); ALTER TABLE chat1_message ADD FOREIGN KEY (receiver) REFERENCES wcf1_user (userID) ON DELETE CASCADE; diff --git a/package.xml b/package.xml index b00faac..693862e 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@ 1 - 3.0.0 Alpha 25 + 3.0.0 Alpha 26 2011-11-26