WHERE packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$packageID]);
+
+ /** @var Application $application */
$application = $statement->fetchObject(Application::class);
// build redirect location
* @return string
*/
public function stepUninstall() {
+ /** @noinspection PhpUndefinedMethodInspection */
$node = $this->installation->uninstall($this->node);
if ($node == '') {
WHERE packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$packageID]);
+
+ /** @var Application $application */
$application = $statement->fetchObject(Application::class);
// build redirect location
/**
* object condition object type types
- * @var ObjectType[]
+ * @var ObjectType[][]
*/
public $conditions = [];
/**
* grouped ad condition object types
- * @var array
+ * @var ObjectType[][]
*/
public $groupedConditionObjectTypes = [];
/**
* grouped notice condition object types
- * @var array
+ * @var ObjectType[][]
*/
public $groupedConditionObjectTypes = [];
$this->signature = $this->disableSignatureReason = $this->disableSignatureExpires = '';
$this->groupIDs = [];
$this->languageID = $this->getDefaultFormLanguageID();
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->resetOptionValues();
}
}
/**
- * wcf\acp\form\AbstractOptionListForm::initOptionHandler()
+ * @inheritDoc
*/
protected function initOptionHandler() {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->setUser($this->user->getDecoratedObject());
}
<?php
namespace wcf\acp\form;
+use wcf\data\object\type\ObjectType;
use wcf\data\user\group\assignment\UserGroupAssignmentAction;
use wcf\data\user\group\UserGroup;
use wcf\form\AbstractForm;
/**
* list of grouped user group assignment condition object types
- * @var array
+ * @var ObjectType[][]
*/
public $conditions = [];
if (isset($_POST['title'])) $this->title = StringUtil::trim($_POST['title']);
foreach ($this->conditions as $conditions) {
+ /** @var ObjectType $condition */
foreach ($conditions as $condition) {
$condition->getProcessor()->readFormParameters();
}
$conditions = $this->assignment->getConditions();
foreach ($conditions as $condition) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->conditions[$condition->getObjectType()->conditiongroup][$condition->objectTypeID]->getProcessor()->setData($condition);
}
}
$this->group = new UserGroupEditor($group);
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->setUserGroup($group);
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->init();
}
use wcf\data\user\UserList;
use wcf\form\AbstractForm;
use wcf\system\condition\IUserCondition;
+use wcf\system\condition\UserGroupCondition;
use wcf\system\event\EventHandler;
use wcf\system\exception\UserInputException;
use wcf\system\request\LinkHandler;
/**
* list of grouped user group assignment condition object types
- * @var array
+ * @var ObjectType[][]
*/
public $conditions = [];
// manually inject user group data for listing of group members
if ($this->groupID && $objectType->objectType == 'com.woltlab.wcf.userGroup') {
+ /** @var UserGroupCondition $processor */
+
$userGroups = UserGroup::getAccessibleGroups([], [UserGroup::EVERYONE, UserGroup::GUESTS]);
uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) {
case 'wcf\system\cache\source\RedisCacheSource':
// set version
+ /** @noinspection PhpUndefinedMethodInspection */
$this->cacheData['version'] = 'Redis '.CacheHandler::getInstance()->getCacheSource()->getRedisVersion();
break;
}
<?php
namespace wcf\acp\page;
+use wcf\data\package\Package;
use wcf\data\package\PackageCache;
use wcf\data\template\group\TemplateGroup;
use wcf\data\template\TemplateList;
$package->getName();
}
- uasort($this->availableApplications, function ($a, $b) {
+ uasort($this->availableApplications, function (Package $a, Package $b) {
return $a->getName() > $b->getName();
});
}
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\event\EventHandler;
use wcf\system\exception\IllegalLinkException;
+use wcf\system\option\user\IUserOptionOutput;
use wcf\system\option\IOptionHandler;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
/**
* list of users
- * @var User[]
+ * @var UserProfile[]
*/
public $users = [];
if (isset($this->options[$column])) {
if ($this->options[$column]->outputClass) {
$this->options[$column]->setOptionValue($user->getDecoratedObject());
+
+ /** @var IUserOptionOutput $outputObj */
$outputObj = $this->options[$column]->getOutputObject();
$this->columnValues[$user->userID][$column] = $outputObj->getOutput($user->getDecoratedObject(), $this->options[$column]->getDecoratedObject(), $user->{$column});
}
protected function sendResponse() {
// add benchmark and debug data
if (ENABLE_BENCHMARK) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->response['benchmark'] = [
'executionTime' => WCF::getBenchmark()->getExecutionTime().'s',
'memoryUsage' => WCF::getBenchmark()->getMemoryUsage(),
];
if (ENABLE_DEBUG_MODE) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->response['benchmark']['items'] = WCF::getBenchmark()->getItems();
}
}
use wcf\data\user\UserProfile;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
+use wcf\system\user\notification\event\IUserNotificationEvent;
use wcf\system\user\notification\UserNotificationHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
}
$className = $event->className;
+
+ /** @var IUserNotificationEvent $notificationEvent */
$notificationEvent = new $className($event);
$notificationEvent->setObject(
$this->notification,
function logThrowable($e, &$logFile = null) {
if ($logFile === null) $logFile = WCF_DIR . 'log/' . gmdate('Y-m-d', TIME_NOW) . '.txt';
touch($logFile);
-
+
// don't forget to update ExceptionLogViewPage, when changing the log file format
+ /** @noinspection PhpUndefinedMethodInspection */
$message = gmdate('r', TIME_NOW)."\n".
'Message: '.str_replace("\n", ' ', $e->getMessage())."\n".
'PHP version: '.phpversion()."\n".
'Referrer: '.(isset($_SERVER['HTTP_REFERER']) ? str_replace("\n", ' ', $_SERVER['HTTP_REFERER']) : '')."\n".
'User Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? str_replace("\n", ' ', $_SERVER['HTTP_USER_AGENT']) : '')."\n".
'Peak Memory Usage: '.memory_get_peak_usage().'/'.FileUtil::getMemoryLimit()."\n";
+ /** @noinspection PhpUndefinedMethodInspection */
do {
+ /** @noinspection PhpUndefinedMethodInspection */
$message .= "======\n".
'Error Class: '.get_class($e)."\n".
'Error Message: '.str_replace("\n", ' ', $e->getMessage())."\n".
return $item;
}
}, $item['args']);
-
+
return $item;
}, sanitizeStacktrace($e, true))))."\n";
}
while ($e = $e->getPrevious());
-
+
// calculate Exception-ID
$exceptionID = sha1($message);
$entry = "<<<<<<<<".$exceptionID."<<<<\n".$message."<<<<\n\n";
-
+
file_put_contents($logFile, $entry, FILE_APPEND);
return $exceptionID;
}
*/
public function __get($name) {
/** @noinspection PhpUndefinedClassInspection */
+ /** @noinspection PhpUndefinedMethodInspection */
$value = parent::__get($name);
if ($value !== null) {
return $value;
if (!empty($this->categoryIDs)) {
foreach ($this->categoryIDs as $categoryID) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->categories[$categoryID] = $className::getCategory($categoryID);
}
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->getObjectID()]);
while ($categoryID = $statement->fetchColumn()) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->categories[$categoryID] = $className::getCategory($categoryID);
}
}
// check max count of uploads
$handler = new AttachmentHandler($this->parameters['objectType'], intval($this->parameters['objectID']), $this->parameters['tmpHash']);
+ /** @noinspection PhpUndefinedMethodInspection */
if ($handler->count() + count($this->parameters['__files']->getFiles()) > $processor->getMaxCount()) {
throw new UserInputException('files', 'exceededQuota', [
'current' => $handler->count(),
}
// check max filesize, allowed file extensions etc.
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->validateFiles(new DefaultUploadFileValidationStrategy($processor->getMaxSize(), $processor->getAllowedExtensions()));
}
'tmpHash' => (!$this->parameters['objectID'] ? $this->parameters['tmpHash'] : '')
]);
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->saveFiles($saveStrategy);
$attachments = $saveStrategy->getObjects();
* @inheritDoc
*/
public function toggleContainer() {
- $collapsibleObjectTypeName = $this->objects[0]->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent');
+ $collapsibleObjectTypeName = $this->getObjects()[0]->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent');
if ($collapsibleObjectTypeName === null) {
throw new SystemException("Categories of this type don't support collapsing");
}
public function update() {
// check if showOrder needs to be recalculated
if (count($this->objects) == 1 && isset($this->parameters['data']['parentCategoryID']) && isset($this->parameters['data']['showOrder'])) {
- if ($this->objects[0]->parentCategoryID != $this->parameters['data']['parentCategoryID'] || $this->objects[0]->showOrder != $this->parameters['data']['showOrder']) {
- $this->parameters['data']['showOrder'] = $this->objects[0]->updateShowOrder($this->parameters['data']['parentCategoryID'], $this->parameters['data']['showOrder']);
+ $categoryEditor = $this->getObjects()[0];
+ if ($categoryEditor->parentCategoryID != $this->parameters['data']['parentCategoryID'] || $categoryEditor->showOrder != $this->parameters['data']['showOrder']) {
+ $this->parameters['data']['showOrder'] = $categoryEditor->updateShowOrder($this->parameters['data']['parentCategoryID'], $this->parameters['data']['showOrder']);
}
}
<?php
namespace wcf\data\clipboard\item;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\clipboard\ClipboardEditorItem;
use wcf\system\clipboard\ClipboardHandler;
use wcf\system\event\EventHandler;
use wcf\system\exception\UserInputException;
'items' => []
];
+ /** @var ClipboardEditorItem $item */
foreach ($itemData['items'] as $showOrder => $item) {
$items['items'][$showOrder] = [
'actionName' => $item->getName(),
foreach ($likeData as $objectTypeID => $likes) {
$objectType = CommentHandler::getInstance()->getObjectType($objectTypeID);
if (CommentHandler::getInstance()->getCommentManager($objectType->objectType) instanceof IViewableLikeProvider) {
+ /** @noinspection PhpUndefinedMethodInspection */
CommentHandler::getInstance()->getCommentManager($objectType->objectType)->prepare($likes);
}
}
foreach ($likeData as $objectTypeID => $likes) {
$objectType = CommentHandler::getInstance()->getObjectType($objectTypeID);
if (CommentHandler::getInstance()->getCommentManager($objectType->objectType) instanceof IViewableLikeProvider) {
+ /** @noinspection PhpUndefinedMethodInspection */
CommentHandler::getInstance()->getCommentManager($objectType->objectType)->prepare($likes);
}
}
use wcf\data\AbstractDatabaseObjectAction;
use wcf\data\IToggleAction;
use wcf\system\cronjob\CronjobScheduler;
+use wcf\system\cronjob\ICronjob;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\WCF;
use wcf\util\DateUtil;
// it now time for executing
$cronjob->update(['state' => Cronjob::EXECUTING]);
$className = $cronjob->className;
+
+ /** @var ICronjob $executable */
$executable = new $className();
// execute cronjob
// update showOrder if required
if (count($this->objects) === 1 && isset($this->parameters['data']['groupID']) && isset($this->parameters['data']['showOrder'])) {
- if ($this->objects[0]->groupID != $this->parameters['data']['groupID'] || $this->objects[0]->showOrder != $this->parameters['data']['showOrder']) {
- $this->objects[0]->setShowOrder($this->parameters['data']['groupID'], $this->parameters['data']['showOrder']);
+ $labelEditor = $this->getObjects()[0];
+ if ($labelEditor->groupID != $this->parameters['data']['groupID'] || $labelEditor->showOrder != $this->parameters['data']['showOrder']) {
+ $labelEditor->setShowOrder($this->parameters['data']['groupID'], $this->parameters['data']['showOrder']);
}
}
}
use wcf\system\request\LinkHandler;
use wcf\system\upload\DefaultUploadFileSaveStrategy;
use wcf\system\upload\MediaUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
use wcf\system\WCF;
use wcf\util\FileUtil;
throw new UserInputException('fileTypeFilters');
}
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->validateFiles(new MediaUploadFileValidationStrategy(isset($this->parameters['fileTypeFilters']) ? $this->parameters['fileTypeFilters'] : []));
}
'username' => WCF::getUser()->username
]);
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->saveFiles($saveStrategy);
$mediaFiles = $saveStrategy->getObjects();
}
}
+ /** @var UploadFile[] $files */
+ /** @noinspection PhpUndefinedMethodInspection */
$files = $this->parameters['__files']->getFiles();
foreach ($files as $file) {
if ($file->getValidationErrorType()) {
* @inheritDoc
*/
public function getSearchResultList() {
+ /** @noinspection PhpUndefinedMethodInspection */
return $this->pageEditor->getHandler()->lookup($this->parameters['data']['searchString']);
}
}
else {
$d = DateUtil::getDateTimeByTimestamp($this->parameters['data']['startDate']);
+ /** @noinspection PhpUndefinedMethodInspection */
$d->add($this->parameters['subscription']->getDateInterval());
$this->parameters['data']['endDate'] = $d->getTimestamp();
}
/**
* @inheritDoc
+ * @return Smiley
*/
public function current() {
$objectID = $this->indexToObject[$this->index];
/**
* @inheritDoc
+ * @return Smiley|null
*/
public function search($objectID) {
try {
* @return string
*/
public function getPageLogo() {
- if ($this->object->getVariable('pageLogo')) {
- return $this->getImage($this->object->getVariable('pageLogo'));
+ if ($this->getDecoratedObject()->getVariable('pageLogo')) {
+ return $this->getImage($this->getDecoratedObject()->getVariable('pageLogo'));
}
return '';
use wcf\system\request\LinkHandler;
use wcf\system\style\StyleHandler;
use wcf\system\upload\DefaultUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
+use wcf\system\upload\UploadHandler;
use wcf\system\Regex;
use wcf\system\WCF;
use wcf\util\FileUtil;
$this->style = $styles[$this->parameters['styleID']];
}
- if (count($this->parameters['__files']->getFiles()) != 1) {
+ /** @var UploadHandler $uploadHandler */
+ $uploadHandler = $this->parameters['__files'];
+
+ if (count($uploadHandler->getFiles()) != 1) {
throw new IllegalLinkException();
}
// check max filesize, allowed file extensions etc.
- $this->parameters['__files']->validateFiles(new DefaultUploadFileValidationStrategy(PHP_INT_MAX, ['jpg', 'jpeg', 'png', 'gif']));
+ $uploadHandler->validateFiles(new DefaultUploadFileValidationStrategy(PHP_INT_MAX, ['jpg', 'jpeg', 'png', 'gif']));
}
/**
*/
public function upload() {
// save files
+ /** @var UploadFile[] $files */
$files = $this->parameters['__files']->getFiles();
$file = $files[0];
*/
public function uploadLogo() {
// save files
+ /** @var UploadFile[] $files */
$files = $this->parameters['__files']->getFiles();
$file = $files[0];
case 'files':
$elements = $xpath->query('child::*', $category);
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$data[$element->tagName] = $element->nodeValue;
if ($element->hasAttribute('path')) {
if ($this->parameters['userID']) {
$eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$this->parameters['userID']]);
}
- else if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
- $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
+ else {
+ /** @noinspection PhpUndefinedMethodInspection */
+ if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
+ /** @noinspection PhpUndefinedMethodInspection */
+ $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
+ }
}
$eventList->readObjects();
throw new PermissionDeniedException();
}
+ /** @noinspection PhpUndefinedMethodInspection */
if (count($this->parameters['__files']->getFiles()) != 1) {
throw new UserInputException('files');
}
// check max filesize, allowed file extensions etc.
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['__files']->validateFiles(new AvatarUploadFileValidationStrategy(PHP_INT_MAX, explode("\n", WCF::getSession()->getPermission('user.profile.avatar.allowedFileExtensions'))));
}
*/
public function upload() {
/** @var UploadFile[] $files */
+ /** @noinspection PhpUndefinedMethodInspection */
$files = $this->parameters['__files']->getFiles();
$userID = (!empty($this->parameters['userID']) ? intval($this->parameters['userID']) : WCF::getUser()->userID);
$user = ($userID != WCF::getUser()->userID ? new User($userID) : WCF::getUser());
// update user
if ($avatarID) {
- $this->parameters['userEditor']->update([
+ /** @var UserEditor $userEditor */
+ $userEditor = $this->parameters['userEditor'];
+
+ $userEditor->update([
'avatarID' => $avatarID,
'enableGravatar' => 0
]);
// delete old avatar
- if ($this->parameters['userEditor']->avatarID) {
- $action = new UserAvatarAction([$this->parameters['userEditor']->avatarID], 'delete');
+ if ($userEditor->avatarID) {
+ $action = new UserAvatarAction([$userEditor->avatarID], 'delete');
$action->executeAction();
}
}
if ($page !== null) {
if ($page->getHandler() !== null && $page->getHandler() instanceof IOnlineLocationPageHandler) {
// refer to page handler
+ /** @noinspection PhpUndefinedMethodInspection */
$this->location = $page->getHandler()->getOnlineLocation($page, $this);
return true;
}
if (WCF::getUser()->userID) return true;
break;
case 2: // following
+ /** @noinspection PhpUndefinedMethodInspection */
if (WCF::getUserProfileHandler()->isFollower($userID)) return true;
break;
}
/**
* list of notification events
- * @var IUserNotificationEvent[]
+ * @var IUserNotificationEvent[][]
*/
public $events = null;
<?php
namespace wcf\form;
use wcf\acp\form\UserAddForm;
+use wcf\data\object\type\ObjectType;
use wcf\data\user\avatar\Gravatar;
use wcf\data\user\avatar\UserAvatarAction;
use wcf\data\user\group\UserGroup;
public $message = '';
/**
- * @inheritDoc
+ * captcha object type object
+ * @var ObjectType
*/
- public $captchaObjectType = null;
+ public $captchaObjectType;
/**
- * @inheritDoc
+ * name of the captcha object type; if empty, captcha is disabled
+ * @var string
*/
public $captchaObjectTypeName = CAPTCHA_TYPE;
/**
- * @inheritDoc
+ * true if captcha is used
+ * @var boolean
*/
public $useCaptcha = REGISTER_USE_CAPTCHA;
}
/**
- * wcf\acp\form\AbstractOptionListForm::initOptionHandler()
+ * @inheritDoc
*/
protected function initOptionHandler() {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->setInRegistration();
parent::initOptionHandler();
}
* @inheritDoc
*/
protected function initOptionHandler() {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->enableSearchMode();
$this->optionHandler->init();
}
$option = $option['object'];
$value = isset($this->optionHandler->optionValues[$option->optionName]) ? $this->optionHandler->optionValues[$option->optionName] : null;
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->getTypeObject($option->optionType)->getCondition($this->conditions, $option, $value);
}
}
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\DatabaseObjectList;
use wcf\system\edit\IHistorySavingObject;
+use wcf\system\edit\IHistorySavingObjectTypeProvider;
use wcf\system\exception\IllegalLinkException;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
}
if (!$this->objectType) throw new IllegalLinkException();
+
+ /** @var IHistorySavingObjectTypeProvider $processor */
$processor = $this->objectType->getProcessor();
+
+ /** @var IHistorySavingObject object */
$this->object = $processor->getObjectByID($this->objectID);
if (!$this->object->getObjectID()) throw new IllegalLinkException();
$processor->checkPermissions($this->object);
if ($userOnline->controller) {
$page = PageCache::getInstance()->getPage($userOnline->pageID);
if ($page !== null && $page->getHandler() !== null && $page->getHandler() instanceof IOnlineLocationPageHandler) {
+ /** @noinspection PhpUndefinedMethodInspection */
$page->getHandler()->prepareOnlineLocation($page, $userOnline);
}
}
$this->getInstallationDirectories();
$this->initLanguage();
$this->initTPL();
+ /** @noinspection PhpUndefinedMethodInspection */
self::getLanguage()->loadLanguage();
$this->getPackageName();
}
if ($parser->getOutputType() == 'text/html') {
+ /** @noinspection PhpUndefinedMethodInspection */
$highlightedContent = self::fixMarkup(explode("\n", $className::getInstance()->highlight($content)));
// show template
+ /** @noinspection PhpUndefinedMethodInspection */
WCF::getTPL()->assign([
'lineNumbers' => self::makeLineNumbers($content, $this->startLineNumber),
'startLineNumber' => $this->startLineNumber,
foreach ($smilies as $categoryID => $categorySmilies) {
if ($categories[$categoryID ?: null]->isDisabled) continue;
+ /** @var Smiley $smiley */
foreach ($categorySmilies as $smiley) {
foreach ($smiley->smileyCodes as $smileyCode) {
$this->smilies[$smileyCode] = '<img src="'.$smiley->getURL().'" alt="'.StringUtil::encodeHTML($smiley->smileyCode).'" />';
foreach ($smilies as $categoryID => $categorySmilies) {
if ($categories[$categoryID ?: null]->isDisabled) continue;
+ /** @var Smiley $smiley */
foreach ($categorySmilies as $smiley) {
foreach ($smiley->smileyCodes as $smileyCode) {
$this->smilies[$smileyCode] = '<img src="'.$smiley->getURL().'" alt="'.StringUtil::encodeHTML($smiley->smileyCode).'" />';
$class = '\wcf\system\bbcode\highlighter\\'.ucfirst($type).'Highlighter';
+ /** @noinspection PhpUndefinedMethodInspection */
return $openingTag.StringStack::pushToStringStack('<span class="'.$type.'Highlighter">'.$class::getInstance()->highlight($content).'</span>', 'htmlHighlighter'.ucfirst($type)).$closingTag;
}));
}
*/
protected function getObjectList() {
$objectList = new UsersOnlineList();
+ /** @noinspection PhpUndefinedMethodInspection */
$objectList->getConditionBuilder()->add('session.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
return $objectList;
* @inheritDoc
*/
public function hasContent() {
+ /** @noinspection PhpUndefinedMethodInspection */
if (!MODULE_USERS_ONLINE || !WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') || empty(WCF::getUserProfileHandler()->getFollowingUsers())) {
return false;
}
* @inheritDoc
*/
protected function getTemplate() {
+ /** @noinspection PhpUndefinedMethodInspection */
return WCF::getTPL()->fetch('boxPageComments', 'wcf', [
'commentCanAdd' => WCF::getSession()->getPermission('user.pageComment.canAddComment'),
'commentList' => $this->objectList,
* @inheritDoc
*/
public function __construct() {
+ /** @noinspection PhpUndefinedMethodInspection */
if (WCF::getUser()->userID && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
$this->canFilterByFollowedUsers = true;
}
*/
public function getTemplate() {
if ($this->getBox()->position == 'contentTop' || $this->getBox()->position == 'contentBottom') {
+ /** @noinspection PhpUndefinedMethodInspection */
return WCF::getTPL()->fetch('boxRecentActivity', 'wcf', [
'canFilterByFollowedUsers' => $this->canFilterByFollowedUsers,
'eventList' => $this->objectList,
protected function readObjects() {
// apply filter
if (($this->getBox()->position == 'contentTop' || $this->getBox()->position == 'contentBottom') && $this->filteredByFollowedUsers) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->objectList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
}
* @inheritDoc
*/
protected function filterUserIDs(&$userIDs) {
+ /** @noinspection PhpUndefinedMethodInspection */
$userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers());
}
}
}
$aclOptions = ACLHandler::getInstance()->getPermissions(ACLHandler::getInstance()->getObjectTypeID($aclObjectType), array_keys($categories));
+ /** @noinspection PhpUndefinedMethodInspection */
$options = $aclOptions['options']->getObjects();
foreach (['group', 'user'] as $type) {
);
// store options
+ /** @noinspection PhpUndefinedMethodInspection */
$data['options'] = $permissions['options']->getObjects();
// assign permissions for each label group
$labelList = new LabelList();
$labelList->readObjects();
foreach ($labelList as $label) {
+ /** @noinspection PhpUndefinedMethodInspection */
$data['groups'][$label->groupID]->addLabel($label);
}
}
}
}
+ /** @var IWorker $worker */
$worker = new $class($parameters);
$worker->validate();
$worker->getProgress(); // make sure objects are counted
namespace wcf\system\clipboard;
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\DatabaseObject;
+use wcf\data\DatabaseObjectList;
use wcf\system\cache\builder\ClipboardActionCacheBuilder;
use wcf\system\cache\builder\ClipboardPageCacheBuilder;
use wcf\system\clipboard\action\IClipboardAction;
// read objects
foreach ($data as $objectType => $objectData) {
+ /** @var DatabaseObjectList $objectList */
$objectList = new $objectData['className']();
$objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias() . "." . $objectList->getDatabaseTableIndexName() . " IN (?)", [$objectData['objectIDs']]);
$objectList->readObjects();
// execute actions
$editorData = [];
foreach ($actions as $actionData) {
+ /** @var IClipboardAction $clipboardAction */
+ $clipboardAction = $actionData['object'];
+
// get accepted objects
- $typeName = $actionData['object']->getTypeName();
+ $typeName = $clipboardAction->getTypeName();
if (!isset($this->markedItems[$typeName]) || empty($this->markedItems[$typeName])) continue;
if (!isset($editorData[$typeName])) {
$editorData[$typeName] = [
- 'label' => $actionData['object']->getEditorLabel($this->markedItems[$typeName]),
+ 'label' => $clipboardAction->getEditorLabel($this->markedItems[$typeName]),
'items' => []
];
}
foreach ($actionData['actions'] as $actionObject) {
- $data = $actionData['object']->execute($this->markedItems[$typeName], $actionObject);
+ $data = $clipboardAction->execute($this->markedItems[$typeName], $actionObject);
if ($data === null) {
continue;
}
* @inheritDoc
*/
protected function getFieldElement() {
+ /** @noinspection PhpUndefinedMethodInspection */
$categoryTree = (new $this->nodeTreeClassname($this->objectType))->getIterator();
$categoryCount = iterator_count($categoryTree);
$option = $option['object'];
if (isset($optionValues[$option->optionName])) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->optionHandler->getTypeObject($option->optionType)->addCondition($objectList, $option, $optionValues[$option->optionName]);
}
}
$option = $option['object'];
if (isset($optionValues[$option->optionName])) {
+ /** @noinspection PhpUndefinedMethodInspection */
if (!$this->optionHandler->getTypeObject($option->optionType)->checkUser($user, $option, $optionValues[$option->optionName])) {
$checkSuccess = false;
break;
$option = $option['object'];
if (isset($optionValues[$option->optionName])) {
+ /** @noinspection PhpUndefinedMethodInspection */
$conditionData = $this->optionHandler->getTypeObject($option->optionType)->getConditionData($option, $optionValues[$option->optionName]);
if ($conditionData !== null) {
$data[$option->optionName] = $conditionData;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\mail\Mail;
+use wcf\system\user\notification\event\IUserNotificationEvent;
use wcf\system\user\notification\UserNotificationHandler;
use wcf\system\WCF;
use wcf\util\StringUtil;
// load objects associated with each object type
foreach ($objectTypes as $objectType => $objectData) {
+ /** @noinspection PhpUndefinedMethodInspection */
$objectTypes[$objectType]['objects'] = $objectData['objectType']->getObjectsByIDs($objectData['objectIDs']);
}
$notification = $notificationObjects[$notificationID];
$className = $eventObjects[$notification->eventID]->className;
+
+ /** @var IUserNotificationEvent $class */
$class = new $className($eventObjects[$notification->eventID]);
$class->setObject(
$notification,
}
$adapterClassName = get_class($this->adapter);
+
+ /** @var IImageAdapter $overlayImage */
$overlayImage = new $adapterClassName();
$overlayImage->loadFile($file);
$overlayHeight = $overlayImage->getHeight();
*
* @method boolean close()
* @method boolean eof()
+ * @method integer filesize()
* @method string gets($length = null)
* @method resource open($mode, $use_include_path = false, $context = null)
- * @method integer seek($offset, $whence = SEEK_SET)
* @method string read($length)
+ * @method integer seek($offset, $whence = SEEK_SET)
+ * @method array stat()
* @method integer tell()
* @method boolean touch($time = 0, $atime = 0) note: default value of `$time` actually is `time()`
* @method integer write($string, $length = null)
<?php
namespace wcf\system\label\object\type;
-use wcf\data\object\type\ObjectType;
use wcf\data\object\type\ObjectTypeCache;
/**
/**
* list of object types
- * @var ObjectType[]
+ * @var LabelObjectType[]
*/
public $objectTypes = [];
/**
* @inheritDoc
+ * @return LabelObjectType
*/
public function current() {
return $this->objectTypes[$this->position];
namespace wcf\system\message;
use wcf\data\DatabaseObjectDecorator;
use wcf\data\IAttachmentMessageQuickReplyAction;
+use wcf\data\IDatabaseObjectAction;
use wcf\data\IMessage;
use wcf\data\IMessageQuickReplyAction;
use wcf\data\IVisitableObjectAction;
if ($pageNo == $parameters['pageNo']) {
// check for additional messages
$messageList = $object->getMessageList($this->container, $parameters['lastPostTime']);
-
+
// calculate start index
$startIndex = $count - (count($messageList) - 1);
// update visit time (messages shouldn't occur as new upon next visit)
if (is_subclass_of($containerActionClassName, IVisitableObjectAction::class)) {
+ /** @var IDatabaseObjectAction $containerAction */
$containerAction = new $containerActionClassName([($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)], 'markAsRead');
$containerAction->executeAction();
}
* @package com.woltlab.wcf
* @subpackage system.message.quote
* @category Community Framework
+ *
+ * Note: We cannot use mixin here as that causes errors about methods not being implemented.
+ * @method string getExcerpt($maxLength = 255)
+ * @method string getFormattedMessage()
+ * @method string getLink()
+ * @method string getMessage()
+ * @method integer getTime()
+ * @method string getTitle()
+ * @method integer getUserID()
+ * @method string getUsername()
+ * @method boolean isVisible()
*/
class QuotedMessage implements \Countable, \Iterator {
/**
* @inheritDoc
*/
protected function checkVisibility(Option $option) {
+ /** @var UserOption $option */
+
if ($option->isDisabled) {
return false;
}
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\SystemException;
use wcf\system\language\LanguageFactory;
+use wcf\system\package\plugin\IPackageInstallationPlugin;
use wcf\system\setup\Uninstaller;
use wcf\system\style\StyleHandler;
use wcf\system\user\storage\UserStorageHandler;
* @inheritDoc
*/
protected function executePIP(array $nodeData) {
+ /** @var IPackageInstallationPlugin $pip */
$pip = new $nodeData['className']($this);
$pip->uninstall();
case 'requiredpackages':
$requiredPackages = $xpath->query('child::*', $child);
+
+ /** @var \DOMElement $requiredPackage */
foreach ($requiredPackages as $requiredPackage) {
$minVersion = $requiredPackage->getAttribute('minversion');
$required = $requiredPackage->nodeValue;
* Sorts results by title.
*/
public function sort() {
- usort($this->results, function($a, $b) {
+ usort($this->results, function(ACPSearchResult $a, ACPSearchResult $b) {
return strcmp($a->getTitle(), $b->getTitle());
});
}
}
// read categories
+ /** @var DatabaseObjectList $categoryList */
$categoryList = new $this->listClassName();
$categoryList->readObjects();
$statement->execute($conditions->getParameters());
$menuItems = ACPMenu::getInstance()->menuItemList;
+
+ /** @var ACPMenuItem $menuItem */
while ($menuItem = $statement->fetchObject(ACPMenuItem::class)) {
// only valid menu items exist in TreeMenu::$menuItemList,
// so no need to call AbstractACPSearchResultProvider::validate()
'%'.$query.'%'
], $conditions->getParameters()));
+ /** @var Package $package */
while ($package = $statement->fetchObject(Package::class)) {
$results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', [
'id' => $package->packageID,
*/
public function getTags($slice = 50) {
// slice list
+ /** @var TagCloudTag[] $tags */
$tags = array_slice($this->tags, 0, min($slice, count($this->tags)));
// get min / max counter
<?php
namespace wcf\system\upload;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\IDatabaseObjectAction;
use wcf\data\IFile;
use wcf\data\IThumbnailFile;
use wcf\system\exception\ImplementationException;
throw new ParentClassException($this->actionClassName, AbstractDatabaseObjectAction::class);
}
+ /** @noinspection PhpUndefinedMethodInspection */
$this->editorClassName = (new $this->actionClassName([], ''))->getClassName();
$baseClass = call_user_func([$this->editorClassName, 'getBaseClass']);
if (!is_subclass_of($baseClass, IFile::class)) {
}
}
+ /** @var IDatabaseObjectAction $action */
$action = new $this->actionClassName([], 'create', [
'data' => $data
]);
+
+ /** @var IThumbnailFile $object */
$object = $action->executeAction()['returnValues'];
$dir = dirname($object->getLocation());
}
if (!empty($updateData)) {
+ /** @noinspection PhpUndefinedMethodInspection */
(new $this->editorClassName($file))->update($updateData);
}
}
/**
* Returns the list of grouped user group assignment condition object types.
*
- * @return array
+ * @return ObjectType[][]
*/
public function getGroupedObjectTypes() {
return $this->groupedObjectTypes;
class UserNotificationHandler extends SingletonFactory {
/**
* list of available object types
- * @var IUserNotificationEvent[][]
+ * @var IUserNotificationObjectType[]
*/
protected $availableObjectTypes = [];
/**
* list of available events
- * @var array
+ * @var IUserNotificationEvent[][]
*/
protected $availableEvents = [];
// load objects associated with each object type
foreach ($objectTypes as $objectType => $objectData) {
+ /** @noinspection PhpUndefinedMethodInspection */
$objectTypes[$objectType]['objects'] = $objectData['objectType']->getObjectsByIDs($objectData['objectIDs']);
}
// check access
foreach ($notifications as $index => $notificationData) {
- if (!$notificationData['event']->checkAccess()) {
- if ($notificationData['event']->deleteNoAccessNotification()) {
- $deleteNotifications[] = $notificationData['event']->getNotification();
+ /** @var IUserNotificationEvent $event */
+ $event = $notificationData['event'];
+ if (!$event->checkAccess()) {
+ if ($event->deleteNoAccessNotification()) {
+ $deleteNotifications[] = $event->getNotification();
}
unset($notifications[$index]);