use wcf\system\exception\UserInputException;
use wcf\system\like\LikeHandler;
use wcf\system\user\activity\event\UserActivityEventHandler;
+use wcf\system\user\notification\object\type\ICommentUserNotificationObjectType;
use wcf\system\user\notification\object\type\IMultiRecipientCommentUserNotificationObjectType;
use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
use wcf\system\user\notification\object\CommentUserNotificationObject;
}
}
else {
+ /** @var ICommentUserNotificationObjectType $notificationObjectType */
+
$userID = $notificationObjectType->getOwnerID($this->createdComment->commentID);
if ($userID != WCF::getUser()->userID) {
UserNotificationHandler::getInstance()->fireEvent(
}
}
else {
+ /** @var ICommentUserNotificationObjectType $notificationObjectType */
+
$userID = $notificationObjectType->getOwnerID($this->comment->commentID);
if ($this->comment->userID != WCF::getUser()->userID) {
*/
protected static $databaseTableIndexName = 'templateGroupID';
+ /**
+ * @var TemplateGroup[][]
+ */
protected static $templateGroupStructure = null;
protected static $selectList = null;
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Database
+ *
+ * @method integer del($key1, $key2 = null, $key3 = null)
+ * @method boolean expire($key, $ttl)
+ * @method string|bool get($key)
+ * @method integer hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null)
+ * @method string hGet($key, $hashKey)
+ * @method integer hSet($key, $hashKey, $value)
+ * @method integer incr($key)
+ * @method string info($option = null)
+ * @method boolean setex($key, $ttl, $value)
+ * @method boolean setnx($key, $value)
+ * @method integer ttl($key)
*/
class Redis {
/**
* @inheritDoc
*/
protected function getConcatenatedParts($parts) {
+ /** @var \SplObjectStorage $parts */
+
$sortedParts = new \SplPriorityQueue();
$parts->rewind();
* @inheritDoc
*/
protected function getFormElement($type, Option $option) {
- if ($this->searchMode) return $this->getTypeObject($type)->getSearchFormElement($option, (isset($this->optionValues[$option->optionName]) ? $this->optionValues[$option->optionName] : null));
+ if ($this->searchMode) {
+ /** @noinspection PhpUndefinedMethodInspection */
+ return $this->getTypeObject($type)->getSearchFormElement($option, (isset($this->optionValues[$option->optionName]) ? $this->optionValues[$option->optionName] : null));
+ }
return parent::getFormElement($type, $option);
}
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\ILinkableObject;
use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\exception\ImplementationException;
use wcf\system\exception\ParentClassException;
use wcf\system\WCF;
*/
public function getLink($objectID) {
$className = $this->getDecoratedCategoryClass();
+
+ /** @var AbstractDecoratedCategory $category */
+ /** @noinspection PhpUndefinedMethodInspection */
$category = $className::getCategory($objectID);
if ($category instanceof ILinkableObject) {
public function isValid($objectID = null) {
$className = $this->getDecoratedCategoryClass();
+ /** @noinspection PhpUndefinedMethodInspection */
return $className::getCategory($objectID)->isAccessible();
}
if (!is_subclass_of($className, AbstractDecoratedCategory::class)) {
throw new ParentClassException($className, AbstractDecoratedCategory::class);
}
+ if (!is_subclass_of($className, ILinkableObject::class)) {
+ throw new ImplementationException($className, ILinkableObject::class);
+ }
if (!defined($className.'::OBJECT_TYPE_NAME')) {
throw new \LogicException("Class '{$className}' has no constant 'OBJECT_TYPE_NAME'.");
}
$statement->execute($conditionBuilder->getParameters());
$results = [];
while ($categoryID = $statement->fetchColumn()) {
- /** @var AbstractDecoratedCategory $category */
+ /** @var AbstractDecoratedCategory|ILinkableObject $category */
+ /** @noinspection PhpUndefinedMethodInspection */
$category = $className::getCategory($categoryID);
// build hierarchy
$className = $this->getDecoratedCategoryClass();
/** @var AbstractDecoratedCategory $category */
+ /** @noinspection PhpUndefinedMethodInspection */
$category = $className::getCategory($objectID);
// check if category exists
}
/** @var AbstractDecoratedCategory $category */
+ /** @noinspection PhpUndefinedMethodInspection */
$category = $className::getCategory($user->pageObjectID);
if ($category === null) {
return '';
<?php
namespace wcf\system\upload;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\DatabaseObjectEditor;
use wcf\data\IDatabaseObjectAction;
use wcf\data\IFile;
use wcf\data\IThumbnailFile;
// update width, height and filesize of the object
if ($newImage !== null && ($orientation == ExifUtil::ORIENTATION_90_ROTATE || $orientation == ExifUtil::ORIENTATION_270_ROTATE)) {
- (new $this->editorClassName($object))->update([
+ /** @var DatabaseObjectEditor $editor */
+ $editor = new $this->editorClassName($object);
+ $editor->update([
'height' => $object->width,
'width' => $object->height,
'filesize' => filesize($object->getLocation())
$this->objects[$uploadFile->getInternalFileID()] = $object;
}
catch (SystemException $e) {
- (new $this->editorClassName($object))->delete();
+ /** @var DatabaseObjectEditor $editor */
+ $editor = new $this->editorClassName($object);
+ $editor->delete();
}
}
else {
- (new $this->editorClassName($object))->delete();
+ /** @var DatabaseObjectEditor $editor */
+ $editor = new $this->editorClassName($object);
+ $editor->delete();
}
if ($object->isImage && !empty($this->options['generateThumbnails']) && $object instanceof IThumbnailFile) {
$this->generateThumbnails($object);
}
catch (SystemException $e) {
- (new $this->editorClassName($object))->delete();
+ /** @var DatabaseObjectEditor $editor */
+ $editor = new $this->editorClassName($object);
+ $editor->delete();
}
}
}