From: Matthias Schmidt Date: Sun, 31 Jul 2016 07:08:22 +0000 (+0200) Subject: Remove unnecessary parentheses X-Git-Tag: 3.0.0_Beta_1~859 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=63b9817b83a13273eafbbfd93391d439ea23140a;p=GitHub%2FWoltLab%2FWCF.git Remove unnecessary parentheses --- diff --git a/wcfsetup/install.php b/wcfsetup/install.php index 4deab78807..636b7a333f 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -398,7 +398,7 @@ class SystemException extends \Exception implements IPrintableException { getPrevious())); + } while ($e = $this->getPrevious()); ?> @@ -780,7 +780,7 @@ class Tar { } if(($header['size'] % 512) != 0) { $buffer = $this->file->read(512); - $content .= substr($buffer, 0, ($header['size'] % 512)); + $content .= substr($buffer, 0, $header['size'] % 512); } return $content; @@ -820,7 +820,7 @@ class Tar { } if (($header['size'] % 512) != 0) { $content = $this->file->read(512); - $targetFile->write($content, ($header['size'] % 512)); + $targetFile->write($content, $header['size'] % 512); } $targetFile->close(); @@ -876,7 +876,7 @@ class Tar { $i++; } - $this->file->seek($this->file->tell() + (512 * ceil(($header['size'] / 512)))); + $this->file->seek($this->file->tell() + (512 * ceil($header['size'] / 512))); } } @@ -1026,7 +1026,7 @@ class ZipFile extends File { */ public function __construct($filename, $mode = 'wb') { if (self::$gzopen64 === null) { - self::$gzopen64 = (function_exists('gzopen64')); + self::$gzopen64 = function_exists('gzopen64'); } $this->filename = $filename; diff --git a/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php b/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php index 1c0c488a95..f7e0294c58 100644 --- a/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php @@ -110,7 +110,7 @@ class WorkerProxyAction extends AJAXInvokeAction { // build return values $returnValues = [ 'className' => $this->className, - 'loopCount' => ($this->loopCount + 1), + 'loopCount' => $this->loopCount + 1, 'parameters' => $parameters, 'proceedURL' => $proceedURL, 'progress' => $progress diff --git a/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php index b58082695b..f2f162c4e5 100644 --- a/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php @@ -314,23 +314,23 @@ class ArticleAddForm extends AbstractForm { if ($this->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'tags' => (!empty($this->tags[$language->languageID]) ? $this->tags[$language->languageID] : []), - 'teaser' => (!empty($this->teaser[$language->languageID]) ? $this->teaser[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'imageID' => (!empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null) + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'tags' => !empty($this->tags[$language->languageID]) ? $this->tags[$language->languageID] : [], + 'teaser' => !empty($this->teaser[$language->languageID]) ? $this->teaser[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'imageID' => !empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null ]; } } else { $content[0] = [ - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'tags' => (!empty($this->tags[0]) ? $this->tags[0] : []), - 'teaser' => (!empty($this->teaser[0]) ? $this->teaser[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'imageID' => (!empty($this->imageID[0]) ? $this->imageID[0] : null) + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'tags' => !empty($this->tags[0]) ? $this->tags[0] : [], + 'teaser' => !empty($this->teaser[0]) ? $this->teaser[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'imageID' => !empty($this->imageID[0]) ? $this->imageID[0] : null ]; } @@ -338,7 +338,7 @@ class ArticleAddForm extends AbstractForm { 'time' => $this->timeObj->getTimestamp(), 'categoryID' => $this->categoryID, 'publicationStatus' => $this->publicationStatus, - 'publicationDate' => ($this->publicationStatus == Article::DELAYED_PUBLICATION ? $this->publicationDateObj->getTimestamp() : 0), + 'publicationDate' => $this->publicationStatus == Article::DELAYED_PUBLICATION ? $this->publicationDateObj->getTimestamp() : 0, 'enableComments' => $this->enableComments, 'userID' => $this->author->userID, 'username' => $this->author->username, diff --git a/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php b/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php index 01dead1c66..22d053ade0 100644 --- a/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php @@ -67,30 +67,30 @@ class ArticleEditForm extends ArticleAddForm { if ($this->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'tags' => (!empty($this->tags[$language->languageID]) ? $this->tags[$language->languageID] : []), - 'teaser' => (!empty($this->teaser[$language->languageID]) ? $this->teaser[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'imageID' => (!empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null) + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'tags' => !empty($this->tags[$language->languageID]) ? $this->tags[$language->languageID] : [], + 'teaser' => !empty($this->teaser[$language->languageID]) ? $this->teaser[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'imageID' => !empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null ]; } } else { $content[0] = [ - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'tags' => (!empty($this->tags[0]) ? $this->tags[0] : []), - 'teaser' => (!empty($this->teaser[0]) ? $this->teaser[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'imageID' => (!empty($this->imageID[0]) ? $this->imageID[0] : null) + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'tags' => !empty($this->tags[0]) ? $this->tags[0] : [], + 'teaser' => !empty($this->teaser[0]) ? $this->teaser[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'imageID' => !empty($this->imageID[0]) ? $this->imageID[0] : null ]; } $data = [ 'categoryID' => $this->categoryID, 'publicationStatus' => $this->publicationStatus, - 'publicationDate' => ($this->publicationStatus == Article::DELAYED_PUBLICATION ? $this->publicationDateObj->getTimestamp() : 0), + 'publicationDate' => $this->publicationStatus == Article::DELAYED_PUBLICATION ? $this->publicationDateObj->getTimestamp() : 0, 'enableComments' => $this->enableComments, 'userID' => $this->author->userID, 'username' => $this->author->username, @@ -146,7 +146,7 @@ class ArticleEditForm extends ArticleAddForm { $this->tags[$languageID] = TagEngine::getInstance()->getObjectTags( 'com.woltlab.wcf.article', $content->articleContentID, - [($languageID ?: LanguageFactory::getInstance()->getDefaultLanguageID())] + [$languageID ?: LanguageFactory::getInstance()->getDefaultLanguageID()] ); } } diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php index 64e480ce8b..33d74bb59d 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php @@ -222,10 +222,10 @@ class BBCodeAddForm extends AbstractForm { 'className' => $this->className, 'htmlOpen' => $this->htmlOpen, 'htmlClose' => $this->htmlClose, - 'isBlockElement' => ($this->isBlockElement ? 1 : 0), - 'isSourceCode' => ($this->isSourceCode ? 1 : 0), + 'isBlockElement' => $this->isBlockElement ? 1 : 0, + 'isSourceCode' => $this->isSourceCode ? 1 : 0, 'packageID' => 1, - 'showButton' => ($this->showButton ? 1 : 0), + 'showButton' => $this->showButton ? 1 : 0, 'wysiwygIcon' => $this->wysiwygIcon ])]); $returnValues = $this->objectAction->executeAction(); diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php index df848a24b6..6747446c58 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php @@ -96,9 +96,9 @@ class BBCodeEditForm extends BBCodeAddForm { 'className' => $this->className, 'htmlClose' => $this->htmlClose, 'htmlOpen' => $this->htmlOpen, - 'isBlockElement' => ($this->isBlockElement ? 1 : 0), - 'isSourceCode' => ($this->isSourceCode ? 1 : 0), - 'showButton' => ($this->showButton ? 1 : 0), + 'isBlockElement' => $this->isBlockElement ? 1 : 0, + 'isSourceCode' => $this->isSourceCode ? 1 : 0, + 'showButton' => $this->showButton ? 1 : 0, 'wysiwygIcon' => $this->wysiwygIcon ])]); $this->objectAction->executeAction(); @@ -162,7 +162,7 @@ class BBCodeEditForm extends BBCodeAddForm { WCF::getTPL()->assign([ 'bbcode' => $this->bbcode, 'action' => 'edit', - 'nativeBBCode' => (in_array($this->bbcode->bbcodeTag, self::$nativeBBCodes)) + 'nativeBBCode' => in_array($this->bbcode->bbcodeTag, self::$nativeBBCodes) ]); } } diff --git a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php index 9b17532883..21e84a6e52 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php @@ -441,19 +441,19 @@ class BoxAddForm extends AbstractForm { if ($this->boxType == 'system' || $this->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'imageID' => (!empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null) + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'imageID' => !empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null ]; } } else { $content[0] = [ - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'imageID' => (!empty($this->imageID[0]) ? $this->imageID[0] : null) + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'imageID' => !empty($this->imageID[0]) ? $this->imageID[0] : null ]; } @@ -468,7 +468,7 @@ class BoxAddForm extends AbstractForm { 'cssClassName' => $this->cssClassName, 'showHeader' => $this->showHeader, 'linkPageID' => $this->linkPageID, - 'linkPageObjectID' => ($this->linkPageObjectID ?: 0), + 'linkPageObjectID' => $this->linkPageObjectID ?: 0, 'externalURL' => $this->externalURL, 'identifier' => '' ]; diff --git a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php index 72baa42fd7..8e6dcc7e65 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php @@ -81,19 +81,19 @@ class BoxEditForm extends BoxAddForm { if ($this->boxType == 'system' || $this->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'imageID' => (!empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null) + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'imageID' => !empty($this->imageID[$language->languageID]) ? $this->imageID[$language->languageID] : null ]; } } else { $content[0] = [ - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'imageID' => (!empty($this->imageID[0]) ? $this->imageID[0] : null) + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'imageID' => !empty($this->imageID[0]) ? $this->imageID[0] : null ]; } @@ -107,7 +107,7 @@ class BoxEditForm extends BoxAddForm { 'cssClassName' => $this->cssClassName, 'showHeader' => $this->showHeader, 'linkPageID' => $this->linkPageID, - 'linkPageObjectID' => ($this->linkPageObjectID ?: 0), + 'linkPageObjectID' => $this->linkPageObjectID ?: 0, 'externalURL' => $this->externalURL ]; if ($this->boxControllerID) { diff --git a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php index fe12d22428..4a3891dd8f 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php @@ -159,7 +159,7 @@ class LabelAddForm extends AbstractForm { // save label $this->objectAction = new LabelAction([], 'create', ['data' => array_merge($this->additionalFields, [ 'label' => $this->label, - 'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName), + 'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'groupID' => $this->groupID, 'showOrder' => $this->showOrder ])]); diff --git a/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php index 8bc5a70ae7..40257c6e38 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php @@ -73,7 +73,7 @@ class LabelEditForm extends LabelAddForm { // assigned to them, but the new group is not allowed at their current position $this->objectAction = new LabelAction([$this->labelID], 'update', ['data' => array_merge($this->additionalFields, [ 'label' => $this->label, - 'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName), + 'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'showOrder' => $this->showOrder ])]); $this->objectAction->executeAction(); diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index 8a6b1a2826..237ff36068 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -159,7 +159,7 @@ class LabelGroupAddForm extends AbstractForm { // save label $this->objectAction = new LabelGroupAction([], 'create', ['data' => array_merge($this->additionalFields, [ - 'forceSelection' => ($this->forceSelection ? 1 : 0), + 'forceSelection' => $this->forceSelection ? 1 : 0, 'groupName' => $this->groupName, 'groupDescription' => $this->groupDescription, 'showOrder' => $this->showOrder @@ -283,17 +283,17 @@ class LabelGroupAddForm extends AbstractForm { foreach ($this->labelObjectTypeContainers as $objectTypeID => $container) { if ($container->isBooleanOption()) { - $optionValue = (isset($data[$objectTypeID])) ? 1 : 0; + $optionValue = isset($data[$objectTypeID]) ? 1 : 0; $container->setOptionValue($optionValue); } else { - $hasData = (isset($data[$objectTypeID])); + $hasData = isset($data[$objectTypeID]); foreach ($container as $object) { if (!$hasData) { $object->setOptionValue(0); } else { - $optionValue = (in_array($object->getObjectID(), $data[$objectTypeID])) ? 1 : 0; + $optionValue = in_array($object->getObjectID(), $data[$objectTypeID]) ? 1 : 0; $object->setOptionValue($optionValue); } } diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php index cee3859765..69aa01e9c2 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php @@ -69,7 +69,7 @@ class LabelGroupEditForm extends LabelGroupAddForm { // update label $this->objectAction = new LabelGroupAction([$this->groupID], 'update', ['data' => array_merge($this->additionalFields, [ - 'forceSelection' => ($this->forceSelection ? 1 : 0), + 'forceSelection' => $this->forceSelection ? 1 : 0, 'groupName' => $this->groupName, 'groupDescription' => $this->groupDescription, 'showOrder' => $this->showOrder @@ -145,7 +145,7 @@ class LabelGroupEditForm extends LabelGroupAddForm { } // prevent NULL values which confuse isset() - $data[$row['objectTypeID']][] = ($row['objectID']) ?: 0; + $data[$row['objectTypeID']][] = $row['objectID'] ?: 0; } } diff --git a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php index e96729a5d9..f60a269f39 100755 --- a/wcfsetup/install/files/lib/acp/form/LoginForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LoginForm.class.php @@ -153,8 +153,8 @@ class LoginForm extends AbstractCaptchaForm { $action = new UserAuthenticationFailureAction([], 'create', [ 'data' => [ - 'environment' => (RequestHandler::getInstance()->isACPRequest() ? 'admin' : 'user'), - 'userID' => ($user->userID ?: null), + 'environment' => RequestHandler::getInstance()->isACPRequest() ? 'admin' : 'user', + 'userID' => $user->userID ?: null, 'username' => $this->username, 'time' => TIME_NOW, 'ipAddress' => UserUtil::getIpAddress(), diff --git a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php index 5b7c7583ae..772ce2ce4f 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php @@ -160,8 +160,8 @@ class MenuAddForm extends AbstractForm { 'name' => $this->title, 'boxType' => 'menu', 'position' => $this->position, - 'visibleEverywhere' => ($this->visibleEverywhere) ? 1 : 0, - 'showHeader' => ($this->showHeader) ? 1 : 0, + 'visibleEverywhere' => $this->visibleEverywhere ? 1 : 0, + 'showHeader' => $this->showHeader ? 1 : 0, 'showOrder' => $this->showOrder, 'cssClassName' => $this->cssClassName, 'packageID' => 1 diff --git a/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php index 994330afb9..7d9effbc34 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php @@ -82,8 +82,8 @@ class MenuEditForm extends MenuAddForm { if ($this->menu->identifier != 'com.woltlab.wcf.MainMenu') { $boxAction = new BoxAction([$this->menu->getBox()->boxID], 'update', ['data' => array_merge($this->additionalFields, [ 'position' => $this->position, - 'visibleEverywhere' => ($this->visibleEverywhere) ? 1 : 0, - 'showHeader' => ($this->showHeader) ? 1 : 0, + 'visibleEverywhere' => $this->visibleEverywhere ? 1 : 0, + 'showHeader' => $this->showHeader ? 1 : 0, 'showOrder' => $this->showOrder, 'cssClassName' => $this->cssClassName ]), 'pageIDs' => $this->pageIDs]); diff --git a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php index c110cd215a..7b60b8fa1d 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php @@ -221,10 +221,10 @@ class MenuItemAddForm extends AbstractForm { parent::save(); $this->objectAction = new MenuItemAction([], 'create', ['data' => array_merge($this->additionalFields, [ - 'isDisabled' => ($this->isDisabled) ? 1 : 0, + 'isDisabled' => $this->isDisabled ? 1 : 0, 'title' => $this->title, 'pageID' => $this->pageID, - 'pageObjectID' => ($this->pageObjectID ?: 0), + 'pageObjectID' => $this->pageObjectID ?: 0, 'externalURL' => $this->externalURL, 'menuID' => $this->menuID, 'parentItemID' => $this->parentItemID, diff --git a/wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php index 17f62fe923..41803de3ec 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php @@ -88,10 +88,10 @@ class MenuItemEditForm extends MenuItemAddForm { // update menu $this->objectAction = new MenuItemAction([$this->itemID], 'update', ['data' => array_merge($this->additionalFields, [ - 'isDisabled' => ($this->isDisabled) ? 1 : 0, + 'isDisabled' => $this->isDisabled ? 1 : 0, 'title' => $this->title, 'pageID' => $this->pageID, - 'pageObjectID' => ($this->pageObjectID ?: 0), + 'pageObjectID' => $this->pageObjectID ?: 0, 'externalURL' => $this->externalURL, 'parentItemID' => $this->parentItemID, 'showOrder' => $this->showOrder diff --git a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php index 007aa15bcb..d6149d2443 100755 --- a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php @@ -152,7 +152,7 @@ class PackageStartInstallForm extends AbstractForm { $processNo = PackageInstallationQueue::getNewProcessNo(); // obey foreign key - $packageID = ($this->package) ? $this->package->packageID : null; + $packageID = $this->package ? $this->package->packageID : null; $archive = null; if ($this->stylePackageImportLocation) { @@ -171,8 +171,8 @@ class PackageStartInstallForm extends AbstractForm { 'packageName' => PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getLocalizedPackageInfo('packageName'), 'packageID' => $packageID, 'archive' => $archive, - 'action' => ($this->package != null ? 'update' : 'install'), - 'isApplication' => (!$isApplication ? '0' : '1') + 'action' => $this->package != null ? 'update' : 'install', + 'isApplication' => !$isApplication ? '0' : '1' ]); $this->saved(); diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 627dfb8b52..7f4ee640ef 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -412,31 +412,31 @@ class PageAddForm extends AbstractForm { if ($this->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'customURL' => (!empty($this->customURL[$language->languageID]) ? $this->customURL[$language->languageID] : ''), - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'metaDescription' => (!empty($this->metaDescription[$language->languageID]) ? $this->metaDescription[$language->languageID] : ''), - 'metaKeywords' => (!empty($this->metaKeywords[$language->languageID]) ? $this->metaKeywords[$language->languageID] : '') + 'customURL' => !empty($this->customURL[$language->languageID]) ? $this->customURL[$language->languageID] : '', + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'metaDescription' => !empty($this->metaDescription[$language->languageID]) ? $this->metaDescription[$language->languageID] : '', + 'metaKeywords' => !empty($this->metaKeywords[$language->languageID]) ? $this->metaKeywords[$language->languageID] : '' ]; } } else { $content[0] = [ - 'customURL' => (!empty($this->customURL[0]) ? $this->customURL[0] : ''), - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'metaDescription' => (!empty($this->metaDescription[0]) ? $this->metaDescription[0] : ''), - 'metaKeywords' => (!empty($this->metaKeywords[0]) ? $this->metaKeywords[0] : '') + 'customURL' => !empty($this->customURL[0]) ? $this->customURL[0] : '', + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'metaDescription' => !empty($this->metaDescription[0]) ? $this->metaDescription[0] : '', + 'metaKeywords' => !empty($this->metaKeywords[0]) ? $this->metaKeywords[0] : '' ]; } $this->objectAction = new PageAction([], 'create', ['data' => array_merge($this->additionalFields, [ - 'parentPageID' => ($this->parentPageID ?: null), + 'parentPageID' => $this->parentPageID ?: null, 'pageType' => $this->pageType, 'name' => $this->name, - 'isDisabled' => ($this->isDisabled) ? 1 : 0, + 'isDisabled' => $this->isDisabled ? 1 : 0, 'isLandingPage' => 0, 'applicationPackageID' => $this->applicationPackageID, 'lastUpdateTime' => TIME_NOW, diff --git a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php index 21ecc66dc0..17deca08b3 100644 --- a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php @@ -134,9 +134,9 @@ class PageEditForm extends PageAddForm { $data = [ 'name' => $this->name, - 'isDisabled' => ($this->isDisabled) ? 1 : 0, + 'isDisabled' => $this->isDisabled ? 1 : 0, 'lastUpdateTime' => TIME_NOW, - 'parentPageID' => ($this->parentPageID ?: null), + 'parentPageID' => $this->parentPageID ?: null, 'applicationPackageID' => $this->applicationPackageID ]; @@ -145,7 +145,7 @@ class PageEditForm extends PageAddForm { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ 'customURL' => '', - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', 'content' => '', 'metaDescription' => '', 'metaKeywords' => '' @@ -165,23 +165,23 @@ class PageEditForm extends PageAddForm { if ($this->page->isMultilingual) { foreach (LanguageFactory::getInstance()->getLanguages() as $language) { $content[$language->languageID] = [ - 'customURL' => (!empty($this->customURL[$language->languageID]) ? $this->customURL[$language->languageID] : ''), - 'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''), - 'content' => (!empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null), - 'metaDescription' => (!empty($this->metaDescription[$language->languageID]) ? $this->metaDescription[$language->languageID] : ''), - 'metaKeywords' => (!empty($this->metaKeywords[$language->languageID]) ? $this->metaKeywords[$language->languageID] : '') + 'customURL' => !empty($this->customURL[$language->languageID]) ? $this->customURL[$language->languageID] : '', + 'title' => !empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : '', + 'content' => !empty($this->content[$language->languageID]) ? $this->content[$language->languageID] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[$language->languageID]) ? $this->htmlInputProcessors[$language->languageID] : null, + 'metaDescription' => !empty($this->metaDescription[$language->languageID]) ? $this->metaDescription[$language->languageID] : '', + 'metaKeywords' => !empty($this->metaKeywords[$language->languageID]) ? $this->metaKeywords[$language->languageID] : '' ]; } } else { $content[0] = [ - 'customURL' => (!empty($this->customURL[0]) ? $this->customURL[0] : ''), - 'title' => (!empty($this->title[0]) ? $this->title[0] : ''), - 'content' => (!empty($this->content[0]) ? $this->content[0] : ''), - 'htmlInputProcessor' => (isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null), - 'metaDescription' => (!empty($this->metaDescription[0]) ? $this->metaDescription[0] : ''), - 'metaKeywords' => (!empty($this->metaKeywords[0]) ? $this->metaKeywords[0] : '') + 'customURL' => !empty($this->customURL[0]) ? $this->customURL[0] : '', + 'title' => !empty($this->title[0]) ? $this->title[0] : '', + 'content' => !empty($this->content[0]) ? $this->content[0] : '', + 'htmlInputProcessor' => isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0] : null, + 'metaDescription' => !empty($this->metaDescription[0]) ? $this->metaDescription[0] : '', + 'metaKeywords' => !empty($this->metaKeywords[0]) ? $this->metaKeywords[0] : '' ]; } diff --git a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php index adcf0bac44..1d6e3e3653 100644 --- a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php @@ -154,7 +154,7 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm { public function assignVariables() { parent::assignVariables(); - $useRequestData = (empty($_POST)) ? false : true; + $useRequestData = empty($_POST) ? false : true; I18nHandler::getInstance()->assignVariables($useRequestData); WCF::getTPL()->assign([ diff --git a/wcfsetup/install/files/lib/acp/form/RescueModeForm.class.php b/wcfsetup/install/files/lib/acp/form/RescueModeForm.class.php index f22c667597..89c1ffe5ce 100644 --- a/wcfsetup/install/files/lib/acp/form/RescueModeForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/RescueModeForm.class.php @@ -232,7 +232,7 @@ class RescueModeForm extends AbstractCaptchaForm { $action = new UserAuthenticationFailureAction([], 'create', [ 'data' => [ 'environment' => 'admin', - 'userID' => ($this->user !== null ? $this->user->userID : null), + 'userID' => $this->user !== null ? $this->user->userID : null, 'username' => $this->username, 'time' => TIME_NOW, 'ipAddress' => UserUtil::getIpAddress(), diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index 66e7dbeb8a..c064a0677e 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -240,7 +240,7 @@ class StyleAddForm extends AbstractForm { foreach ($this->specialVariables as $variableName) { if (isset($_POST[$variableName])) $this->variables[$variableName] = StringUtil::trim($_POST[$variableName]); } - $this->variables['useFluidLayout'] = (isset($_POST['useFluidLayout'])) ? 1 : 0; + $this->variables['useFluidLayout'] = isset($_POST['useFluidLayout']) ? 1 : 0; // style data if (isset($_POST['authorName'])) $this->authorName = StringUtil::trim($_POST['authorName']); diff --git a/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php b/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php index 2b4410d1cd..4dfc8dd1d0 100644 --- a/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php @@ -134,7 +134,7 @@ class TagEditForm extends TagAddForm { WCF::getTPL()->assign([ 'tagObj' => $this->tagObj, 'action' => 'edit', - 'synonym' => (($this->tagObj !== null && $this->tagObj->synonymFor) ? new Tag($this->tagObj->synonymFor) : null) + 'synonym' => ($this->tagObj !== null && $this->tagObj->synonymFor) ? new Tag($this->tagObj->synonymFor) : null ]); } } diff --git a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php index 55d9c66bc7..6eccbe2ce5 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php @@ -130,7 +130,7 @@ class TemplateGroupAddForm extends AbstractForm { $this->objectAction = new TemplateGroupAction([], 'create', ['data' => array_merge($this->additionalFields, [ 'templateGroupName' => $this->templateGroupName, 'templateGroupFolderName' => $this->templateGroupFolderName, - 'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null) + 'parentTemplateGroupID' => $this->parentTemplateGroupID ?: null ])]); $this->objectAction->executeAction(); $this->saved(); diff --git a/wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php index ca02bbe156..1bbfb1f4a3 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php @@ -76,7 +76,7 @@ class TemplateGroupEditForm extends TemplateGroupAddForm { $this->objectAction = new TemplateGroupAction([$this->templateGroup], 'update', ['data' => array_merge($this->additionalFields, [ 'templateGroupName' => $this->templateGroupName, 'templateGroupFolderName' => $this->templateGroupFolderName, - 'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null) + 'parentTemplateGroupID' => $this->parentTemplateGroupID ?: null ])]); $this->objectAction->executeAction(); $this->saved(); diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php index 64d30ab06a..ae612bd85d 100644 --- a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php @@ -212,7 +212,7 @@ class UserGroupOptionForm extends AbstractForm { // create form elements for each group foreach ($this->groups as $group) { - $optionValue = (isset($this->values[$group->groupID])) ? $this->values[$group->groupID] : ''; + $optionValue = isset($this->values[$group->groupID]) ? $this->values[$group->groupID] : ''; $this->formElements[$group->groupID] = $this->optionType->getFormElement($this->userGroupOption, $optionValue); } } diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php index 14ea99e02c..b1183151c9 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php @@ -297,7 +297,7 @@ class UserOptionAddForm extends AbstractForm { 'editable' => $this->editable, 'visible' => $this->visible, 'packageID' => 1, - 'additionalData' => ($this->optionType == 'select' ? serialize(['allowEmptyValue' => true]) : '') + 'additionalData' => $this->optionType == 'select' ? serialize(['allowEmptyValue' => true]) : '' ])]); $this->objectAction->executeAction(); diff --git a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php index fac4f2f497..379c29197e 100644 --- a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php @@ -181,7 +181,7 @@ class UserRankAddForm extends AbstractForm { // save label $this->objectAction = new UserRankAction([], 'create', ['data' => array_merge($this->additionalFields, [ 'rankTitle' => $this->rankTitle, - 'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName), + 'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'groupID' => $this->groupID, 'requiredPoints' => $this->requiredPoints, 'rankImage' => $this->rankImage, diff --git a/wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php index bd30b08e1c..874ca43c01 100644 --- a/wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php @@ -64,7 +64,7 @@ class UserRankEditForm extends UserRankAddForm { // update label $this->objectAction = new UserRankAction([$this->rank], 'update', ['data' => array_merge($this->additionalFields, [ 'rankTitle' => $this->rankTitle, - 'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName), + 'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'groupID' => $this->groupID, 'requiredPoints' => $this->requiredPoints, 'rankImage' => $this->rankImage, diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 4d534b45b9..a840a8427d 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -27,7 +27,7 @@ class IndexPage extends AbstractPage { $this->server = [ 'os' => PHP_OS, - 'webserver' => (isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''), + 'webserver' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '', 'mySQLVersion' => WCF::getDB()->getVersion(), 'load' => '' ]; diff --git a/wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php b/wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php index 8a326238ea..d1381946b4 100644 --- a/wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php @@ -89,7 +89,7 @@ class PluginStorePurchasedItemsPage extends AbstractPage { } $languageCode = WCF::getLanguage()->languageCode; - $packageName = (isset($product['packageName'][$languageCode])) ? $product['packageName'][$languageCode] : $product['packageName']['en']; + $packageName = isset($product['packageName'][$languageCode]) ? $product['packageName'][$languageCode] : $product['packageName']['en']; $this->productData[$wcfMajorRelease][$packageUpdateID] = [ 'author' => $product['author'], @@ -101,7 +101,7 @@ class PluginStorePurchasedItemsPage extends AbstractPage { 'available' => $product['lastVersion'], 'installed' => '' ], - 'status' => (isset($this->updateServers[$wcfMajorRelease]) ? 'install' : 'unavailable') + 'status' => isset($this->updateServers[$wcfMajorRelease]) ? 'install' : 'unavailable' ]; $package = PackageCache::getInstance()->getPackageByIdentifier($product['package']); diff --git a/wcfsetup/install/files/lib/acp/page/TemplateDiffPage.class.php b/wcfsetup/install/files/lib/acp/page/TemplateDiffPage.class.php index 45e70e45e5..03e296cfa7 100644 --- a/wcfsetup/install/files/lib/acp/page/TemplateDiffPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/TemplateDiffPage.class.php @@ -105,7 +105,7 @@ class TemplateDiffPage extends AbstractPage { $templateList->getConditionBuilder()->add('(template.templateGroupID IN(?) OR template.templateGroupID IS NULL)', [array_keys($this->templateGroupHierarchy)]); $templateList->readObjects(); foreach ($templateList as $template) { - $this->templateGroupHierarchy[($template->templateGroupID ?: 0)]['hasTemplate'] = $template->templateID; + $this->templateGroupHierarchy[$template->templateGroupID ?: 0]['hasTemplate'] = $template->templateID; } // a valid parent template was given, calculate diff diff --git a/wcfsetup/install/files/lib/action/MessageQuoteAction.class.php b/wcfsetup/install/files/lib/action/MessageQuoteAction.class.php index 257d27fdfe..f3c383853b 100644 --- a/wcfsetup/install/files/lib/action/MessageQuoteAction.class.php +++ b/wcfsetup/install/files/lib/action/MessageQuoteAction.class.php @@ -132,7 +132,7 @@ class MessageQuoteAction extends AJAXProxyAction { * @return string */ protected function getQuotes() { - $supportPaste = (isset($_POST['supportPaste'])) ? (bool)$_POST['supportPaste'] : false; + $supportPaste = isset($_POST['supportPaste']) ? (bool)$_POST['supportPaste'] : false; return MessageQuoteManager::getInstance()->getQuotes($supportPaste); } diff --git a/wcfsetup/install/files/lib/action/PollAction.class.php b/wcfsetup/install/files/lib/action/PollAction.class.php index f85a9b136b..7a3917dfd6 100644 --- a/wcfsetup/install/files/lib/action/PollAction.class.php +++ b/wcfsetup/install/files/lib/action/PollAction.class.php @@ -200,6 +200,6 @@ class PollAction extends AJAXProxyAction { $this->getVote($returnValues); } - $returnValues['canVote'] = ($this->poll->isChangeable) ? 1 : 0; + $returnValues['canVote'] = $this->poll->isChangeable ? 1 : 0; } } diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index f3b10618c7..04959d78b3 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -137,7 +137,7 @@ namespace wcf\functions\exception { return $item; }, sanitizeStacktrace($e, true))))."\n"; } - while (($e = $e->getPrevious())); + while ($e = $e->getPrevious()); // calculate Exception-ID $exceptionID = sha1($message); @@ -538,7 +538,7 @@ EXPLANATION; getPrevious())); + } while ($e = $e->getPrevious()); ?> diff --git a/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php b/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php index 2ecaaf3e46..f7d8680c74 100644 --- a/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php @@ -41,7 +41,7 @@ class ACLOptionAction extends AbstractDatabaseObjectAction { * @return array */ public function loadAll() { - $objectIDs = ($this->parameters['objectID']) ? [$this->parameters['objectID']] : []; + $objectIDs = $this->parameters['objectID'] ? [$this->parameters['objectID']] : []; $permissions = ACLHandler::getInstance()->getPermissions($this->parameters['objectTypeID'], $objectIDs, $this->parameters['categoryName'], true); return $permissions; diff --git a/wcfsetup/install/files/lib/data/article/Article.class.php b/wcfsetup/install/files/lib/data/article/Article.class.php index 8e41d87d32..b31b613c73 100644 --- a/wcfsetup/install/files/lib/data/article/Article.class.php +++ b/wcfsetup/install/files/lib/data/article/Article.class.php @@ -198,7 +198,7 @@ class Article extends DatabaseObject implements ILinkableObject { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->articleID]); while ($row = $statement->fetchArray()) { - $this->articleContents[($row['languageID'] ?: 0)] = new ArticleContent(null, $row); + $this->articleContents[$row['languageID'] ?: 0] = new ArticleContent(null, $row); } } @@ -219,7 +219,7 @@ class Article extends DatabaseObject implements ILinkableObject { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->articleID]); while ($row = $statement->fetchArray()) { - $this->languageLinks[($row['languageID'] ?: 0)] = new ArticleContent(null, $row); + $this->languageLinks[$row['languageID'] ?: 0] = new ArticleContent(null, $row); } } diff --git a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php index cd57ca28fb..473537a058 100644 --- a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php +++ b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php @@ -67,7 +67,7 @@ class ArticleAction extends AbstractDatabaseObjectAction { /** @var ArticleContent $articleContent */ $articleContent = ArticleContentEditor::create([ 'articleID' => $article->articleID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'teaser' => $content['teaser'], 'content' => $content['content'], @@ -144,7 +144,7 @@ class ArticleAction extends AbstractDatabaseObjectAction { /** @var ArticleContent $articleContent */ $articleContent = ArticleContentEditor::create([ 'articleID' => $article->articleID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'teaser' => $content['teaser'], 'content' => $content['content'], @@ -176,7 +176,7 @@ class ArticleAction extends AbstractDatabaseObjectAction { /** @noinspection PhpUndefinedMethodInspection */ $content['htmlInputProcessor']->setObjectID($articleContent->articleContentID); if ($articleContent->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($content['htmlInputProcessor'])) { - $articleContentEditor->update(['hasEmbeddedObjects' => ($articleContent->hasEmbeddedObjects ? 0 : 1)]); + $articleContentEditor->update(['hasEmbeddedObjects' => $articleContent->hasEmbeddedObjects ? 0 : 1]); } } } diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php index 6ab05921d8..f5c06c638f 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php @@ -78,7 +78,7 @@ class ViewableArticle extends DatabaseObjectDecorator { $this->getDecoratedObject()->articleContents = []; } - $this->getDecoratedObject()->articleContents[($articleContent->languageID ?: 0)] = $articleContent; + $this->getDecoratedObject()->articleContents[$articleContent->languageID ?: 0] = $articleContent; } /** diff --git a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php index 8b6cec1420..09a7787b9f 100644 --- a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php +++ b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php @@ -133,7 +133,7 @@ class Attachment extends DatabaseObject implements IRouteController, IThumbnailF * @inheritDoc */ public function getLocation() { - return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . ($this->attachmentID) . '-' . $this->fileHash; + return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . $this->attachmentID . '-' . $this->fileHash; } /** @@ -150,10 +150,10 @@ class Attachment extends DatabaseObject implements IRouteController, IThumbnailF */ public function getThumbnailLocation($size = '') { if ($size == 'tiny') { - return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . ($this->attachmentID) . '-tiny-' . $this->fileHash; + return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . $this->attachmentID . '-tiny-' . $this->fileHash; } - return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . ($this->attachmentID) . '-thumbnail-' . $this->fileHash; + return self::getStorage() . substr($this->fileHash, 0, 2) . '/' . $this->attachmentID . '-thumbnail-' . $this->fileHash; } /** diff --git a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php index d16bc024c3..8e8b2c8ff0 100644 --- a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php @@ -83,10 +83,10 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable public function validateUpload() { // IE<10 fallback if (isset($_POST['isFallback'])) { - $this->parameters['objectType'] = (isset($_POST['objectType'])) ? $_POST['objectType'] : ''; - $this->parameters['objectID'] = (isset($_POST['objectID'])) ? $_POST['objectID'] : 0; - $this->parameters['parentObjectID'] = (isset($_POST['parentObjectID'])) ? $_POST['parentObjectID'] : 0; - $this->parameters['tmpHash'] = (isset($_POST['tmpHash'])) ? $_POST['tmpHash'] : ''; + $this->parameters['objectType'] = isset($_POST['objectType']) ? $_POST['objectType'] : ''; + $this->parameters['objectID'] = isset($_POST['objectID']) ? $_POST['objectID'] : 0; + $this->parameters['parentObjectID'] = isset($_POST['parentObjectID']) ? $_POST['parentObjectID'] : 0; + $this->parameters['tmpHash'] = isset($_POST['tmpHash']) ? $_POST['tmpHash'] : ''; } // read variables @@ -138,7 +138,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable ], [ 'objectID' => intval($this->parameters['objectID']), 'objectTypeID' => $objectType->objectTypeID, - 'tmpHash' => (!$this->parameters['objectID'] ? $this->parameters['tmpHash'] : '') + 'tmpHash' => !$this->parameters['objectID'] ? $this->parameters['tmpHash'] : '' ]); /** @noinspection PhpUndefinedMethodInspection */ @@ -167,8 +167,8 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable 'formattedFilesize' => FileUtil::formatFilesize($attachment->filesize), 'isImage' => $attachment->isImage, 'attachmentID' => $attachment->attachmentID, - 'tinyURL' => ($attachment->tinyThumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'tiny=1') : ''), - 'thumbnailURL' => ($attachment->thumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'thumbnail=1') : ''), + 'tinyURL' => $attachment->tinyThumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'tiny=1') : '', + 'thumbnailURL' => $attachment->thumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'thumbnail=1') : '', 'url' => LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment]), 'height' => $attachment->height, 'width' => $attachment->width diff --git a/wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php b/wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php index 191cd1aa83..9b39b683ea 100644 --- a/wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php @@ -42,7 +42,7 @@ class MessagePreviewAction extends BBCodeAction { $htmlInputProcessor->process($this->parameters['data']['message'], $this->parameters['messageObjectType'], $this->parameters['messageObjectID']); // check if disallowed bbcode are used - $disallowedBBCodesPermission = (isset($this->parameters['disallowedBBCodesPermission'])) ? $this->parameters['disallowedBBCodesPermission'] : 'user.message.disallowedBBCodes'; + $disallowedBBCodesPermission = isset($this->parameters['disallowedBBCodesPermission']) ? $this->parameters['disallowedBBCodesPermission'] : 'user.message.disallowedBBCodes'; if ($disallowedBBCodesPermission) { BBCodeHandler::getInstance()->setDisallowedBBCodes(ArrayUtil::trim(explode(',', WCF::getSession()->getPermission($disallowedBBCodesPermission)))); $disallowedBBCodes = $htmlInputProcessor->validate(); diff --git a/wcfsetup/install/files/lib/data/box/Box.class.php b/wcfsetup/install/files/lib/data/box/Box.class.php index 21864d9fdd..08d8967c11 100644 --- a/wcfsetup/install/files/lib/data/box/Box.class.php +++ b/wcfsetup/install/files/lib/data/box/Box.class.php @@ -171,7 +171,7 @@ class Box extends DatabaseObject { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->boxID]); while ($row = $statement->fetchArray()) { - $this->boxContents[($row['languageID'] ?: 0)] = new BoxContent(null, $row); + $this->boxContents[$row['languageID'] ?: 0] = new BoxContent(null, $row); } } diff --git a/wcfsetup/install/files/lib/data/box/BoxAction.class.php b/wcfsetup/install/files/lib/data/box/BoxAction.class.php index 88f3ba46c2..7a3df6321d 100644 --- a/wcfsetup/install/files/lib/data/box/BoxAction.class.php +++ b/wcfsetup/install/files/lib/data/box/BoxAction.class.php @@ -74,7 +74,7 @@ class BoxAction extends AbstractDatabaseObjectAction { /** @var BoxContent $boxContent */ $boxContent = BoxContentEditor::create([ 'boxID' => $box->boxID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'content' => $content['content'], 'imageID' => $content['imageID'] @@ -103,7 +103,7 @@ class BoxAction extends AbstractDatabaseObjectAction { $statement->execute([ $box->boxID, $pageID, - ($box->visibleEverywhere ? 0 : 1) + $box->visibleEverywhere ? 0 : 1 ]); } } @@ -150,7 +150,7 @@ class BoxAction extends AbstractDatabaseObjectAction { /** @var BoxContent $boxContent */ $boxContent = BoxContentEditor::create([ 'boxID' => $box->boxID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'content' => $content['content'], 'imageID' => $content['imageID'] @@ -163,7 +163,7 @@ class BoxAction extends AbstractDatabaseObjectAction { /** @noinspection PhpUndefinedMethodInspection */ $content['htmlInputProcessor']->setObjectID($boxContent->boxContentID); if ($boxContent->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($content['htmlInputProcessor'])) { - $boxContentEditor->update(['hasEmbeddedObjects' => ($boxContent->hasEmbeddedObjects ? 0 : 1)]); + $boxContentEditor->update(['hasEmbeddedObjects' => $boxContent->hasEmbeddedObjects ? 0 : 1]); } } } @@ -193,7 +193,7 @@ class BoxAction extends AbstractDatabaseObjectAction { $visibleEverywhere = (isset($this->parameters['data']['visibleEverywhere']) ? $this->parameters['data']['visibleEverywhere'] : $box->visibleEverywhere); foreach ($this->parameters['pageIDs'] as $pageID) { - $insertStatement->execute([$box->boxID, $pageID, ($visibleEverywhere ? 0 : 1)]); + $insertStatement->execute([$box->boxID, $pageID, $visibleEverywhere ? 0 : 1]); } } } diff --git a/wcfsetup/install/files/lib/data/box/BoxList.class.php b/wcfsetup/install/files/lib/data/box/BoxList.class.php index 61dba7100f..fb5f5fe150 100644 --- a/wcfsetup/install/files/lib/data/box/BoxList.class.php +++ b/wcfsetup/install/files/lib/data/box/BoxList.class.php @@ -52,7 +52,7 @@ class BoxList extends DatabaseObjectList { $contentList->getConditionBuilder()->add('(box_content.languageID IS NULL OR box_content.languageID = ?)', [WCF::getLanguage()->languageID]); $contentList->readObjects(); foreach ($contentList as $boxContent) { - $this->objects[$boxContent->boxID]->setBoxContents([($boxContent->languageID ?: 0) => $boxContent]); + $this->objects[$boxContent->boxID]->setBoxContents([$boxContent->languageID ?: 0 => $boxContent]); } } } diff --git a/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php b/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php index e8b555ee89..0d345c26db 100644 --- a/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php +++ b/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php @@ -110,9 +110,9 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje */ public static function create(array $parameters = []) { // default values - $parameters['time'] = (isset($parameters['time'])) ? $parameters['time'] : TIME_NOW; - $parameters['parentCategoryID'] = (isset($parameters['parentCategoryID'])) ? $parameters['parentCategoryID'] : 0; - $parameters['showOrder'] = (isset($parameters['showOrder'])) ? $parameters['showOrder'] : null; + $parameters['time'] = isset($parameters['time']) ? $parameters['time'] : TIME_NOW; + $parameters['parentCategoryID'] = isset($parameters['parentCategoryID']) ? $parameters['parentCategoryID'] : 0; + $parameters['showOrder'] = isset($parameters['showOrder']) ? $parameters['showOrder'] : null; // handle show order $parameters['showOrder'] = static::getShowOrder($parameters['objectTypeID'], $parameters['parentCategoryID'], $parameters['showOrder']); diff --git a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php index 41ea0b5284..f39953553f 100644 --- a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php @@ -182,7 +182,7 @@ class CommentAction extends AbstractDatabaseObjectAction { WCF::getTPL()->assign([ 'commentList' => $commentList, - 'likeData' => (MODULE_LIKE ? $commentList->getLikeData() : []) + 'likeData' => MODULE_LIKE ? $commentList->getLikeData() : [] ]); return [ diff --git a/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php b/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php index 0a2094928f..3dca31241a 100644 --- a/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php @@ -179,7 +179,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction { } WCF::getTPL()->assign([ - 'likeData' => (MODULE_LIKE ? $responseList->getLikeData() : []), + 'likeData' => MODULE_LIKE ? $responseList->getLikeData() : [], 'responseList' => $responseList, 'commentManager' => $this->commentManager ]); diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index cb82328914..1d9cd6b440 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -146,8 +146,8 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio CronjobLogEditor::create([ 'cronjobID' => $cronjob->cronjobID, 'execTime' => TIME_NOW, - 'success' => ($exception ? 0 : 1), - 'error' => ($exception ? $exception->getMessage() : '') + 'success' => $exception ? 0 : 1, + 'error' => $exception ? $exception->getMessage() : '' ]); // calculate next exec-time @@ -155,7 +155,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio $data = [ 'lastExec' => TIME_NOW, 'nextExec' => $nextExec, - 'afterNextExec' => $cronjob->getNextExec(($nextExec + 120)) + 'afterNextExec' => $cronjob->getNextExec($nextExec + 120) ]; // cronjob failed diff --git a/wcfsetup/install/files/lib/data/language/LanguageAction.class.php b/wcfsetup/install/files/lib/data/language/LanguageAction.class.php index 45cade5b18..f5d6eb0f2d 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageAction.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageAction.class.php @@ -83,7 +83,7 @@ class LanguageAction extends AbstractDatabaseObjectAction implements IToggleActi */ public function toggle() { foreach ($this->getObjects() as $language) { - $isDisabled = ($language->isDisabled) ? 0 : 1; + $isDisabled = $language->isDisabled ? 0 : 1; $language->update(['isDisabled' => $isDisabled]); } } diff --git a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php index 88b237f6e3..ad8d0d601f 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php @@ -77,7 +77,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $items[$languageCategoryID] = []; } - $items[$languageCategoryID][$row['languageItem']] = ($row['languageUseCustomValue']) ? $row['languageCustomItemValue'] : $row['languageItemValue']; + $items[$languageCategoryID][$row['languageItem']] = $row['languageUseCustomValue'] ? $row['languageCustomItemValue'] : $row['languageItemValue']; } foreach ($items as $languageCategoryID => $languageItems) { @@ -242,7 +242,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje if (!empty($itemData)) { // insert/update a maximum of 50 items per run (prevents issues with max_allowed_packet) - $step = ($packageID) ? 5 : 4; + $step = $packageID ? 5 : 4; WCF::getDB()->beginTransaction(); for ($i = 0, $length = count($itemData); $i < $length; $i += 50 * $step) { $parameters = array_slice($itemData, $i, 50 * $step); @@ -450,7 +450,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $languageItemEditor = new LanguageItemEditor($languageItem); $languageItemEditor->update([ 'languageCustomItemValue' => $items[$languageItem->languageItem], - 'languageUseCustomValue' => (isset($useCustom[$languageItem->languageItem])) ? 1 : 0 + 'languageUseCustomValue' => isset($useCustom[$languageItem->languageItem]) ? 1 : 0 ]); // remove updated items, leaving items to be created within diff --git a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php index 44b44e5152..3378a34409 100644 --- a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php +++ b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php @@ -100,7 +100,7 @@ class LanguageItemAction extends AbstractDatabaseObjectAction { if ($editor->languageItemOriginIsSystem) { $updateData = [ 'languageCustomItemValue' => !$this->parameters['languageUseCustomValue'] && empty($this->parameters['languageCustomItemValue']) ? null : $this->parameters['languageCustomItemValue'], - 'languageUseCustomValue' => ($this->parameters['languageUseCustomValue'] ? 1 : 0) + 'languageUseCustomValue' => $this->parameters['languageUseCustomValue'] ? 1 : 0 ]; } else { diff --git a/wcfsetup/install/files/lib/data/menu/MenuAction.class.php b/wcfsetup/install/files/lib/data/menu/MenuAction.class.php index 1a8282e4ea..77f05fdddf 100644 --- a/wcfsetup/install/files/lib/data/menu/MenuAction.class.php +++ b/wcfsetup/install/files/lib/data/menu/MenuAction.class.php @@ -55,7 +55,7 @@ class MenuAction extends AbstractDatabaseObjectAction { $boxData = $this->parameters['boxData']; $boxData['menuID'] = $menu->menuID; $boxData['identifier'] = ''; - $boxAction = new BoxAction([], 'create', ['data' => $boxData, 'pageIDs' => (isset($this->parameters['pageIDs']) ? $this->parameters['pageIDs'] : [])]); + $boxAction = new BoxAction([], 'create', ['data' => $boxData, 'pageIDs' => isset($this->parameters['pageIDs']) ? $this->parameters['pageIDs'] : []]); $returnValues = $boxAction->executeAction(); // set generic box identifier diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php index 559feb654e..2474e51b6e 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php @@ -65,7 +65,7 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc */ public function toggle() { foreach ($this->getObjects() as $object) { - $object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]); + $object->update(['isDisabled' => $object->isDisabled ? 0 : 1]); } } @@ -123,7 +123,7 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc foreach ($this->parameters['data']['structure'] as $parentItemID => $children) { foreach ($children as $showOrder => $menuItemID) { $statement->execute([ - ($parentItemID ?: null), + $parentItemID ?: null, $showOrder + 1, $menuItemID ]); diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 555fd50b7a..3fbdc9b9d8 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -194,7 +194,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { * @return string[] */ public function getAssignUserForm() { - $assignedUser = ($this->moderationQueueEditor->assignedUserID) ? new User($this->moderationQueueEditor->assignedUserID) : null; + $assignedUser = $this->moderationQueueEditor->assignedUserID ? new User($this->moderationQueueEditor->assignedUserID) : null; WCF::getTPL()->assign([ 'assignedUser' => $assignedUser, @@ -248,7 +248,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { * @return string[] */ public function assignUser() { - $data = ['assignedUserID' => ($this->parameters['assignedUserID'] ?: null)]; + $data = ['assignedUserID' => $this->parameters['assignedUserID'] ?: null]; if ($this->user->userID) { if ($this->moderationQueueEditor->status == ModerationQueue::STATUS_OUTSTANDING) { $data['status'] = ModerationQueue::STATUS_PROCESSING; @@ -262,7 +262,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { $this->moderationQueueEditor->update($data); - $username = ($this->user->userID) ? $this->user->username : WCF::getLanguage()->get('wcf.moderation.assignedUser.nobody'); + $username = $this->user->userID ? $this->user->username : WCF::getLanguage()->get('wcf.moderation.assignedUser.nobody'); $link = ''; if ($this->user->userID) { $link = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]); diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php index b7955a49e9..025a841309 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php @@ -91,7 +91,7 @@ class ModerationQueueReportAction extends ModerationQueueAction { */ public function prepareReport() { // content was already reported - $alreadyReported = (ModerationQueueReportManager::getInstance()->hasPendingReport($this->parameters['objectType'], $this->parameters['objectID'])) ? 1 : 0; + $alreadyReported = ModerationQueueReportManager::getInstance()->hasPendingReport($this->parameters['objectType'], $this->parameters['objectID']) ? 1 : 0; WCF::getTPL()->assign([ 'alreadyReported' => $alreadyReported, diff --git a/wcfsetup/install/files/lib/data/package/PackageAction.class.php b/wcfsetup/install/files/lib/data/package/PackageAction.class.php index 2bf292f9f1..f4bf63aa9b 100644 --- a/wcfsetup/install/files/lib/data/package/PackageAction.class.php +++ b/wcfsetup/install/files/lib/data/package/PackageAction.class.php @@ -107,7 +107,7 @@ class PackageAction extends AbstractDatabaseObjectAction { $reply = $request->getReply(); $response = JSON::decode($reply['body']); - $code = (isset($response['status'])) ? $response['status'] : 500; + $code = isset($response['status']) ? $response['status'] : 500; switch ($code) { case 200: if (empty($response['products'])) { diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index 6994066515..e2e8bb0291 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -517,7 +517,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { $scheduler = new PackageInstallationScheduler($this->parameters['packages']); try { - $scheduler->buildPackageInstallationStack(($queueType == 'install')); + $scheduler->buildPackageInstallationStack($queueType == 'install'); } catch (PackageUpdateUnauthorizedException $e) { return [ @@ -549,7 +549,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { 'userID' => WCF::getUser()->userID, 'package' => $package['package'], 'packageName' => $package['packageName'], - 'packageID' => ($package['packageID'] ?: null), + 'packageID' => $package['packageID'] ?: null, 'archive' => $package['archive'], 'action' => $package['action'] ]); diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php index 7f9394a0e5..4ab68304b4 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php @@ -53,7 +53,7 @@ class PackageUpdateServerAction extends AbstractDatabaseObjectAction implements */ public function toggle() { foreach ($this->getObjects() as $server) { - $server->update(['isDisabled' => ($server->isDisabled) ? 0 : 1]); + $server->update(['isDisabled' => $server->isDisabled ? 0 : 1]); } } } diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index c53c3b5bac..4b36a34aa1 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -120,7 +120,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->pageID]); while ($row = $statement->fetchArray()) { - $this->pageContents[($row['languageID'] ?: 0)] = new PageContent(null, $row); + $this->pageContents[$row['languageID'] ?: 0] = new PageContent(null, $row); } } diff --git a/wcfsetup/install/files/lib/data/page/PageAction.class.php b/wcfsetup/install/files/lib/data/page/PageAction.class.php index 9e65fa65cf..185bc544b3 100644 --- a/wcfsetup/install/files/lib/data/page/PageAction.class.php +++ b/wcfsetup/install/files/lib/data/page/PageAction.class.php @@ -74,7 +74,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, /** @var PageContent $pageContent */ $pageContent = PageContentEditor::create([ 'pageID' => $page->pageID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'content' => $content['content'], 'metaDescription' => $content['metaDescription'], @@ -157,7 +157,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, /** @var PageContent $pageContent */ $pageContent = PageContentEditor::create([ 'pageID' => $page->pageID, - 'languageID' => ($languageID ?: null), + 'languageID' => $languageID ?: null, 'title' => $content['title'], 'content' => $content['content'], 'metaDescription' => $content['metaDescription'], @@ -172,7 +172,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, /** @noinspection PhpUndefinedMethodInspection */ $content['htmlInputProcessor']->setObjectID($pageContent->pageContentID); if ($pageContent->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($content['htmlInputProcessor'])) { - $pageContentEditor->update(['hasEmbeddedObjects' => ($pageContent->hasEmbeddedObjects ? 0 : 1)]); + $pageContentEditor->update(['hasEmbeddedObjects' => $pageContent->hasEmbeddedObjects ? 0 : 1]); } } else if ($page->pageType == 'html' || $page->pageType == 'tpl') { @@ -245,7 +245,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, */ public function toggle() { foreach ($this->getObjects() as $object) { - $object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]); + $object->update(['isDisabled' => $object->isDisabled ? 0 : 1]); } } diff --git a/wcfsetup/install/files/lib/data/session/Session.class.php b/wcfsetup/install/files/lib/data/session/Session.class.php index 58604117b3..06bb9e94e9 100644 --- a/wcfsetup/install/files/lib/data/session/Session.class.php +++ b/wcfsetup/install/files/lib/data/session/Session.class.php @@ -34,6 +34,6 @@ class Session extends ACPSession { * @inheritDoc */ public static function supportsVirtualSessions() { - return (SESSION_ENABLE_VIRTUALIZATION) ? true : false; + return SESSION_ENABLE_VIRTUALIZATION ? true : false; } } diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index dafa30e04a..39462a197a 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -113,7 +113,7 @@ class Style extends DatabaseObject { $statement->execute([$this->styleID]); while ($row = $statement->fetchArray()) { $variableName = $row['variableName']; - $variableValue = (isset($row['variableValue'])) ? $row['variableValue'] : $row['defaultValue']; + $variableValue = isset($row['variableValue']) ? $row['variableValue'] : $row['defaultValue']; $this->variables[$variableName] = $variableValue; } @@ -144,7 +144,7 @@ class Style extends DatabaseObject { return [ 'preset' => $tmp[0], - 'custom' => (isset($tmp[1])) ? $tmp[1] : '' + 'custom' => isset($tmp[1]) ? $tmp[1] : '' ]; } diff --git a/wcfsetup/install/files/lib/data/style/StyleAction.class.php b/wcfsetup/install/files/lib/data/style/StyleAction.class.php index c14b02bcd4..bdadac970e 100644 --- a/wcfsetup/install/files/lib/data/style/StyleAction.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleAction.class.php @@ -521,7 +521,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction, } } - $number = (count($numbers)) ? max($numbers) + 1 : 2; + $number = count($numbers) ? max($numbers) + 1 : 2; $styleName = $this->styleEditor->styleName . ' ('.$number.')'; // create the new style @@ -653,7 +653,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction, */ public function toggle() { foreach ($this->getObjects() as $style) { - $isDisabled = ($style->isDisabled) ? 0 : 1; + $isDisabled = $style->isDisabled ? 0 : 1; $style->update(['isDisabled' => $isDisabled]); } } @@ -681,7 +681,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction, if (WCF::getUser()->userID) { // set this as the permanent style $userAction = new UserAction([WCF::getUser()], 'update', ['data' => [ - 'styleID' => ($this->style->isDefault ? 0 : $this->style->styleID) + 'styleID' => $this->style->isDefault ? 0 : $this->style->styleID ]]); $userAction->executeAction(); } diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index ea046225c3..5d321cc5ce 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -264,8 +264,8 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio } // insert user groups - $addDefaultGroups = (isset($this->parameters['addDefaultGroups'])) ? $this->parameters['addDefaultGroups'] : true; - $groupIDs = (isset($this->parameters['groups'])) ? $this->parameters['groups'] : []; + $addDefaultGroups = isset($this->parameters['addDefaultGroups']) ? $this->parameters['addDefaultGroups'] : true; + $groupIDs = isset($this->parameters['groups']) ? $this->parameters['groups'] : []; $userEditor->addToGroups($groupIDs, false, $addDefaultGroups); // insert visible languages @@ -323,10 +323,10 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio } } - $groupIDs = (isset($this->parameters['groups'])) ? $this->parameters['groups'] : []; - $languageIDs = (isset($this->parameters['languageIDs'])) ? $this->parameters['languageIDs'] : []; - $removeGroups = (isset($this->parameters['removeGroups'])) ? $this->parameters['removeGroups'] : []; - $userOptions = (isset($this->parameters['options'])) ? $this->parameters['options'] : []; + $groupIDs = isset($this->parameters['groups']) ? $this->parameters['groups'] : []; + $languageIDs = isset($this->parameters['languageIDs']) ? $this->parameters['languageIDs'] : []; + $removeGroups = isset($this->parameters['removeGroups']) ? $this->parameters['removeGroups'] : []; + $userOptions = isset($this->parameters['options']) ? $this->parameters['options'] : []; if (!empty($groupIDs)) { $action = new UserAction($this->objects, 'addToGroups', [ diff --git a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php index 9a8a8197b5..7a9d81f32d 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php @@ -61,9 +61,9 @@ class UserProfileAction extends UserAction { */ public function getMessagePreview() { // get options - $enableBBCodes = (isset($this->parameters['options']['enableBBCodes'])) ? 1 : 0; - $enableHtml = (isset($this->parameters['options']['enableHtml'])) ? 1 : 0; - $enableSmilies = (isset($this->parameters['options']['enableSmilies'])) ? 1 : 0; + $enableBBCodes = isset($this->parameters['options']['enableBBCodes']) ? 1 : 0; + $enableHtml = isset($this->parameters['options']['enableHtml']) ? 1 : 0; + $enableSmilies = isset($this->parameters['options']['enableSmilies']) ? 1 : 0; // validate permissions for options if ($enableBBCodes && !WCF::getSession()->getPermission('user.signature.canUseBBCodes')) $enableBBCodes = 0; @@ -299,7 +299,7 @@ class UserProfileAction extends UserAction { WCF::getTPL()->assign([ 'errorType' => $errors, 'optionTree' => $optionHandler->getOptionTree(), - '__userTitle' => ($userTitle !== null ? $userTitle : $this->userProfile->userTitle) + '__userTitle' => $userTitle !== null ? $userTitle : $this->userProfile->userTitle ]); return [ diff --git a/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php b/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php index 76510d5c92..501d46f5b7 100644 --- a/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php +++ b/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php @@ -97,7 +97,7 @@ class UserActivityEventAction extends AbstractDatabaseObjectAction { /** @noinspection PhpUndefinedFieldInspection */ $userAction = new UserAction([WCF::getUser()], 'update', [ 'options' => [ - User::getUserOptionID('recentActivitiesFilterByFollowing') => (WCF::getUser()->recentActivitiesFilterByFollowing ? 0 : 1) + User::getUserOptionID('recentActivitiesFilterByFollowing') => WCF::getUser()->recentActivitiesFilterByFollowing ? 0 : 1 ] ]); $userAction->executeAction(); diff --git a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php index fd6811949e..86d166e0bf 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php @@ -75,7 +75,7 @@ class UserAvatar extends DatabaseObject implements IUserAvatar { * @return string */ public function getFilename($size = null) { - return substr($this->fileHash, 0, 2) . '/' . ($this->avatarID) . '-' . $this->fileHash . ($size !== null ? ('-' . $size) : '') . '.' . $this->avatarExtension; + return substr($this->fileHash, 0, 2) . '/' . $this->avatarID . '-' . $this->fileHash . ($size !== null ? ('-' . $size) : '') . '.' . $this->avatarExtension; } /** diff --git a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php index 57dd14d6a3..bec706d6c4 100644 --- a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php +++ b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php @@ -87,7 +87,7 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction { // newly subscribed if ($this->userObjectWatch === null) { UserObjectWatchEditor::create([ - 'notification' => ($this->parameters['enableNotification'] ? 1 : 0), + 'notification' => $this->parameters['enableNotification'] ? 1 : 0, 'objectID' => $this->parameters['objectID'], 'objectTypeID' => $this->objectType->objectTypeID, 'userID' => WCF::getUser()->userID @@ -97,7 +97,7 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction { // update notification type $editor = new UserObjectWatchEditor($this->userObjectWatch); $editor->update([ - 'notification' => ($this->parameters['enableNotification'] ? 1 : 0) + 'notification' => $this->parameters['enableNotification'] ? 1 : 0 ]); } @@ -129,7 +129,7 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction { 'userID' => WCF::getUser()->userID, 'objectID' => intval($this->parameters['data']['objectID']), 'objectTypeID' => $objectType->objectTypeID, - 'notification' => (!empty($this->parameters['enableNotification']) ? 1 : 0) + 'notification' => !empty($this->parameters['enableNotification']) ? 1 : 0 ]); // reset user storage diff --git a/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php b/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php index 95f7ded2a7..f467f0043b 100644 --- a/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php @@ -127,7 +127,7 @@ abstract class AbstractModerationForm extends AbstractForm { 'commentCanAdd' => true, 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->commentObjectTypeID, - 'lastCommentTime' => ($this->commentList ? $this->commentList->getMinCommentTime() : 0) + 'lastCommentTime' => $this->commentList ? $this->commentList->getMinCommentTime() : 0 ]); } diff --git a/wcfsetup/install/files/lib/form/MessageForm.class.php b/wcfsetup/install/files/lib/form/MessageForm.class.php index 4e7082229b..d9c487e50f 100644 --- a/wcfsetup/install/files/lib/form/MessageForm.class.php +++ b/wcfsetup/install/files/lib/form/MessageForm.class.php @@ -327,7 +327,7 @@ abstract class MessageForm extends AbstractCaptchaForm { 'attachmentParentObjectID' => $this->attachmentParentObjectID, 'availableContentLanguages' => $this->availableContentLanguages, 'defaultSmilies' => $this->defaultSmilies, - 'languageID' => ($this->languageID ?: 0), + 'languageID' => $this->languageID ?: 0, 'maxTextLength' => $this->maxTextLength, 'smileyCategories' => $this->smileyCategories, 'subject' => $this->subject, diff --git a/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php b/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php index a5100d651e..29db8278a7 100644 --- a/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php @@ -161,7 +161,7 @@ class RegisterNewActivationCodeForm extends AbstractForm { $this->saved(); // forward to index page - HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.user.newActivationCode.success', ['email' => (!empty($this->email) ? $this->email : $this->user->email)]), 10); + HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.user.newActivationCode.success', ['email' => !empty($this->email) ? $this->email : $this->user->email]), 10); exit; } diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index 2ea2b16706..8fcb1f7462 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -347,7 +347,7 @@ class SearchForm extends AbstractCaptchaForm { 'username' => $this->username, 'userID' => $this->userID, 'selectedObjectTypes' => $this->selectedObjectTypes, - 'alterable' => (!$this->userID ? 1 : 0) + 'alterable' => !$this->userID ? 1 : 0 ]; if ($this->modifySearchID) { $this->objectAction = new SearchAction([$this->modifySearchID], 'update', ['data' => [ @@ -360,7 +360,7 @@ class SearchForm extends AbstractCaptchaForm { } else { $this->objectAction = new SearchAction([], 'create', ['data' => [ - 'userID' => (WCF::getUser()->userID ?: null), + 'userID' => WCF::getUser()->userID ?: null, 'searchData' => serialize($this->searchData), 'searchTime' => TIME_NOW, 'searchType' => 'messages', diff --git a/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php b/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php index dcf2274184..1bbbf760e9 100644 --- a/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php @@ -113,7 +113,7 @@ abstract class AbstractArticlePage extends AbstractPage { $this->tags = TagEngine::getInstance()->getObjectTags( 'com.woltlab.wcf.article', $this->articleContent->articleContentID, - [($this->articleContent->languageID ?: LanguageFactory::getInstance()->getDefaultLanguageID())] + [$this->articleContent->languageID ?: LanguageFactory::getInstance()->getDefaultLanguageID()] ); } @@ -128,7 +128,7 @@ abstract class AbstractArticlePage extends AbstractPage { FROM wcf" . WCF_N . "_tag_to_object " . $conditionBuilder . " GROUP BY objectID - HAVING COUNT(*) > " . (round(count($this->tags) * (ARTICLE_RELATED_ARTICLES_MATCH_THRESHOLD / 100))) . " + HAVING COUNT(*) > " . (round(count($this->tags) * ARTICLE_RELATED_ARTICLES_MATCH_THRESHOLD / 100)) . " ORDER BY count DESC"; $statement = WCF::getDB()->prepareStatement($sql, ARTICLE_RELATED_ARTICLES); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/files/lib/page/ArticlePage.class.php b/wcfsetup/install/files/lib/page/ArticlePage.class.php index 4201e15a96..c554ea9fc7 100644 --- a/wcfsetup/install/files/lib/page/ArticlePage.class.php +++ b/wcfsetup/install/files/lib/page/ArticlePage.class.php @@ -137,8 +137,8 @@ class ArticlePage extends AbstractArticlePage { 'commentCanAdd' => WCF::getSession()->getPermission('user.article.canAddComment'), 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->commentObjectTypeID, - 'lastCommentTime' => ($this->commentList ? $this->commentList->getMinCommentTime() : 0), - 'likeData' => ((MODULE_LIKE && $this->commentList) ? $this->commentList->getLikeData() : []), + 'lastCommentTime' => $this->commentList ? $this->commentList->getMinCommentTime() : 0, + 'likeData' => (MODULE_LIKE && $this->commentList) ? $this->commentList->getLikeData() : [], 'articleLikeData' => $this->articleLikeData, 'allowSpidersToIndexThisPage' => true ]); diff --git a/wcfsetup/install/files/lib/page/AttachmentPage.class.php b/wcfsetup/install/files/lib/page/AttachmentPage.class.php index 104323de75..4facaa6ef7 100644 --- a/wcfsetup/install/files/lib/page/AttachmentPage.class.php +++ b/wcfsetup/install/files/lib/page/AttachmentPage.class.php @@ -144,8 +144,8 @@ class AttachmentPage extends AbstractPage { 'filename' => $this->attachment->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, - 'showInline' => (in_array($mimeType, self::$inlineMimeTypes)), - 'enableRangeSupport' => (!$this->tiny && !$this->thumbnail), + 'showInline' => in_array($mimeType, self::$inlineMimeTypes), + 'enableRangeSupport' => !$this->tiny && !$this->thumbnail, 'lastModificationTime' => $this->attachment->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000 diff --git a/wcfsetup/install/files/lib/page/CmsPage.class.php b/wcfsetup/install/files/lib/page/CmsPage.class.php index 2645e74a5b..743ad7b0ec 100644 --- a/wcfsetup/install/files/lib/page/CmsPage.class.php +++ b/wcfsetup/install/files/lib/page/CmsPage.class.php @@ -112,7 +112,7 @@ class CmsPage extends AbstractPage { 'contentLanguageID' => $this->languageID, 'page' => $this->page, 'pageID' => $this->pageID, - 'activePageLanguage' => ($this->languageID ? LanguageFactory::getInstance()->getLanguage($this->languageID) : null), + 'activePageLanguage' => $this->languageID ? LanguageFactory::getInstance()->getLanguage($this->languageID) : null, 'allowSpidersToIndexThisPage' => true ]); } diff --git a/wcfsetup/install/files/lib/page/MediaPage.class.php b/wcfsetup/install/files/lib/page/MediaPage.class.php index 6f83181e48..2b3b43ab69 100644 --- a/wcfsetup/install/files/lib/page/MediaPage.class.php +++ b/wcfsetup/install/files/lib/page/MediaPage.class.php @@ -89,8 +89,8 @@ class MediaPage extends AbstractPage { 'filename' => $this->media->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, - 'showInline' => (in_array($mimeType, self::$inlineMimeTypes)), - 'enableRangeSupport' => ($this->thumbnail ? true : false), + 'showInline' => in_array($mimeType, self::$inlineMimeTypes), + 'enableRangeSupport' => $this->thumbnail ? true : false, 'lastModificationTime' => $this->media->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000 diff --git a/wcfsetup/install/files/lib/page/SearchResultPage.class.php b/wcfsetup/install/files/lib/page/SearchResultPage.class.php index 2473e0ecbf..0a5c85fc0e 100644 --- a/wcfsetup/install/files/lib/page/SearchResultPage.class.php +++ b/wcfsetup/install/files/lib/page/SearchResultPage.class.php @@ -162,7 +162,7 @@ class SearchResultPage extends MultipleLinkPage { 'highlight' => $this->highlight, 'sortField' => $this->searchData['sortField'], 'sortOrder' => $this->searchData['sortOrder'], - 'alterable' => (!empty($this->searchData['alterable']) ? 1 : 0), + 'alterable' => !empty($this->searchData['alterable']) ? 1 : 0, 'objectTypes' => SearchEngine::getInstance()->getAvailableObjectTypes(), 'resultListTemplateName' => $this->resultListTemplateName, 'resultListApplication' => $this->resultListApplication, diff --git a/wcfsetup/install/files/lib/page/UserPage.class.php b/wcfsetup/install/files/lib/page/UserPage.class.php index ec048f5c2c..d62f670b5e 100644 --- a/wcfsetup/install/files/lib/page/UserPage.class.php +++ b/wcfsetup/install/files/lib/page/UserPage.class.php @@ -159,8 +159,8 @@ class UserPage extends AbstractPage { 'followerCount' => $this->followerList->countObjects(), 'following' => $this->followingList->getObjects(), 'followingCount' => $this->followingList->countObjects(), - 'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : []), - 'visitorCount' => ($this->visitorList !== null ? $this->visitorList->countObjects() : 0), + 'visitors' => $this->visitorList !== null ? $this->visitorList->getObjects() : [], + 'visitorCount' => $this->visitorList !== null ? $this->visitorList->countObjects() : 0, 'allowSpidersToIndexThisPage' => true, 'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs()) ]); diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index abcc054b92..badbd5f0cd 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -493,7 +493,7 @@ class WCF { } // refresh the session 1 minute before it expires - self::getTPL()->assign('__sessionKeepAlive', (SESSION_TIMEOUT - 60)); + self::getTPL()->assign('__sessionKeepAlive', SESSION_TIMEOUT - 60); } } @@ -724,7 +724,7 @@ class WCF { } if (class_exists($objectName)) { - if (!(is_subclass_of($objectName, SingletonFactory::class))) { + if (!is_subclass_of($objectName, SingletonFactory::class)) { throw new ParentClassException($objectName, SingletonFactory::class); } @@ -969,7 +969,7 @@ class WCF { */ protected function initCronjobs() { if (PACKAGE_ID) { - self::getTPL()->assign('executeCronjobs', (CronjobScheduler::getInstance()->getNextExec() < TIME_NOW && defined('OFFLINE') && !OFFLINE)); + self::getTPL()->assign('executeCronjobs', CronjobScheduler::getInstance()->getNextExec() < TIME_NOW && defined('OFFLINE') && !OFFLINE); } } } diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 821aa7c527..e030a9dbf3 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -444,7 +444,7 @@ class WCFSetup extends WCF { $application = Package::getAbbreviation($package->getPackageInfo('name')); $packages[$application] = [ - 'directory' => ($package->getPackageInfo('applicationDirectory') ?: $application), + 'directory' => $package->getPackageInfo('applicationDirectory') ?: $application, 'packageDescription' => $package->getLocalizedPackageInfo('packageDescription'), 'packageName' => $package->getLocalizedPackageInfo('packageName') ]; @@ -764,7 +764,7 @@ class WCFSetup extends WCF { // split by offsets $sqlData = explode('/* SQL_PARSER_OFFSET */', $sql); - $offset = (isset($_POST['offset'])) ? intval($_POST['offset']) : 0; + $offset = isset($_POST['offset']) ? intval($_POST['offset']) : 0; if (!isset($sqlData[$offset])) { throw new SystemException("Offset for SQL parser is out of bounds, ".$offset." was requested, but there are only ".count($sqlData)." sections"); } @@ -1146,7 +1146,7 @@ class WCFSetup extends WCF { while ($queueID) { $queueIDs[] = $queueID; - $queueID = (isset($queues[$queueID])) ? $queues[$queueID] : 0; + $queueID = isset($queues[$queueID]) ? $queues[$queueID] : 0; } // remove previously created queues diff --git a/wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php index 0bc513e92e..eaf3eaaad8 100644 --- a/wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php @@ -414,7 +414,7 @@ class BBCodeParser extends SingletonFactory { // start buffering $tag['buffer'] = ''; $bufferedTagStack[] = $tag; - $buffer =& $bufferedTagStack[(count($bufferedTagStack) - 1)]['buffer']; + $buffer =& $bufferedTagStack[count($bufferedTagStack) - 1]['buffer']; } else { $buffer .= $this->buildOpeningTag($tag); diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index f9a582daea..2b358a0de8 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -307,7 +307,7 @@ class HtmlBBCodeParser extends BBCodeParser { // start buffering $tag['buffer'] = ''; $bufferedTagStack[] = $tag; - $buffer =& $bufferedTagStack[(count($bufferedTagStack) - 1)]['buffer']; + $buffer =& $bufferedTagStack[count($bufferedTagStack) - 1]['buffer']; } else { $buffer .= $this->buildOpeningTag($tag); diff --git a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php index 1907f041bb..fd04f4bed9 100644 --- a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php @@ -47,7 +47,7 @@ class QuoteBBCode extends AbstractBBCode { return WCF::getTPL()->fetch('quoteBBCodeTag'); } else if ($parser->getOutputType() == 'text/simplified-html') { - return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.quote.text', ['content' => $content, 'cite' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')])."\n"; + return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.quote.text', ['content' => $content, 'cite' => !empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : ''])."\n"; } } } diff --git a/wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php index 363c057c29..00b5b2890a 100644 --- a/wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php @@ -18,7 +18,7 @@ class SpoilerBBCode extends AbstractBBCode { if ($parser->getOutputType() == 'text/html') { WCF::getTPL()->assign([ 'content' => $content, - 'buttonTitle' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '') + 'buttonTitle' => !empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '' ]); return WCF::getTPL()->fetch('spoilerBBCodeTag'); } diff --git a/wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php b/wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php index 70f0d6696f..abd883b299 100644 --- a/wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php @@ -186,7 +186,7 @@ abstract class Highlighter extends SingletonFactory { if ($quotesRegEx !== '') { $quotesRegEx = '(?:'.$quotesRegEx.')'; - $this->quotesRegEx = new Regex($quotesRegEx, ($this->allowsNewslinesInQuotes) ? Regex::DOT_ALL : Regex::MODIFIER_NONE); + $this->quotesRegEx = new Regex($quotesRegEx, $this->allowsNewslinesInQuotes ? Regex::DOT_ALL : Regex::MODIFIER_NONE); } // cache comment regex diff --git a/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php b/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php index 50a82df961..6957fdf713 100644 --- a/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php +++ b/wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php @@ -59,7 +59,7 @@ class Benchmark extends SingletonFactory { $this->items[$newIndex]['type'] = $type; $this->items[$newIndex]['before'] = self::getMicrotime(); $this->items[$newIndex]['start'] = self::compareMicrotimes($this->startTime, $this->items[$newIndex]['before']); - $this->items[$newIndex]['trace'] = (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) : debug_backtrace(); + $this->items[$newIndex]['trace'] = defined('DEBUG_BACKTRACE_IGNORE_ARGS') ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) : debug_backtrace(); return $newIndex; } diff --git a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php index d6f99dc308..d35fab4d2a 100644 --- a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php +++ b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php @@ -188,7 +188,7 @@ class BoxHandler extends SingletonFactory { VALUES (?, ?, ?)"; $statement = WCF::getDB()->prepareStatement($sql); foreach ($pages as $page) { - $statement->execute([$box->boxID, $page->pageID, ($visible ? 1 : 0)]); + $statement->execute([$box->boxID, $page->pageID, $visible ? 1 : 0]); } } } diff --git a/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php index a728be8e46..68d180a723 100644 --- a/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php @@ -39,7 +39,7 @@ class PageCommentListBoxController extends AbstractDatabaseObjectListBoxControll 'commentObjectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.page'), 'lastCommentTime' => $this->objectList->getMinCommentTime(), 'pageID' => RequestHandler::getInstance()->getActiveRequest()->getPageID(), - 'likeData' => ((MODULE_LIKE && $this->objectList) ? $this->objectList->getLikeData() : []) + 'likeData' => (MODULE_LIKE && $this->objectList) ? $this->objectList->getLikeData() : [] ]); } diff --git a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php index 0190ec0d9a..b13416be82 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -77,7 +77,7 @@ class RoutingCacheBuilder extends AbstractCacheBuilder { $className = $abbreviation . '\\' . ($libDirectory === 'lib/acp' ? 'acp\\' : '') . $pageType . '\\' . $filename; if (!isset($data['lookup'][$abbreviation])) $data['lookup'][$abbreviation] = ['acp' => [], 'frontend' => []]; - $data['lookup'][$abbreviation][($libDirectory === 'lib' ? 'frontend' : 'acp')][$ciController] = $className; + $data['lookup'][$abbreviation][$libDirectory === 'lib' ? 'frontend' : 'acp'][$ciController] = $className; $data['reverse'][$filename] = $ciController; } } diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php index 9476373b16..403cf35430 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php @@ -38,7 +38,7 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder { 'menuItem' => 'wcf.user.option.category.'.$row['categoryName'], 'parentMenuItem' => 'wcf.user.menu.settings', 'menuItemController' => SettingsForm::class, - 'menuItemLink' => ($categoryShortName != 'general' ? 'category='.$categoryShortName : ''), + 'menuItemLink' => $categoryShortName != 'general' ? 'category='.$categoryShortName : '', 'permissions' => $row['permissions'], 'options' => $row['options'] ]); diff --git a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php index bc7eca202e..5bd08ff739 100644 --- a/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php @@ -164,7 +164,7 @@ class PackageCLICommand implements IArgumentedCLICommand { 'packageName' => $archive->getLocalizedPackageInfo('packageName'), 'packageID' => ($package !== null) ? $package->packageID : null, 'archive' => $file, - 'action' => ($package !== null ? 'update' : 'install') + 'action' => $package !== null ? 'update' : 'install' ]); // PackageInstallationDispatcher::openQueue() diff --git a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php index b0817373f6..272d84417a 100644 --- a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php +++ b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php @@ -208,7 +208,7 @@ class CommentHandler extends SingletonFactory { $statement = WCF::getDB()->prepareStatement($sql, 1); $statement->execute([ WCF::getUser()->userID, - (TIME_NOW - WCF::getSession()->getPermission('user.comment.floodControlTime')) + TIME_NOW - WCF::getSession()->getPermission('user.comment.floodControlTime') ]); if (($row = $statement->fetchArray()) !== false) { throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.comment.error.floodControl', ['lastCommentTime' => $row['time']])); @@ -223,7 +223,7 @@ class CommentHandler extends SingletonFactory { $statement = WCF::getDB()->prepareStatement($sql, 1); $statement->execute([ WCF::getUser()->userID, - (TIME_NOW - WCF::getSession()->getPermission('user.comment.floodControlTime')) + TIME_NOW - WCF::getSession()->getPermission('user.comment.floodControlTime') ]); if (($row = $statement->fetchArray()) !== false) { throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.comment.error.floodControl', ['lastCommentTime' => $row['time']])); diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index ac60f0204f..2f294b14d8 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -71,28 +71,28 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme * @inheritDoc */ public function canEditComment(Comment $comment) { - return $this->canEdit(($comment->userID == WCF::getUser()->userID)); + return $this->canEdit($comment->userID == WCF::getUser()->userID); } /** * @inheritDoc */ public function canEditResponse(CommentResponse $response) { - return $this->canEdit(($response->userID == WCF::getUser()->userID)); + return $this->canEdit($response->userID == WCF::getUser()->userID); } /** * @inheritDoc */ public function canDeleteComment(Comment $comment) { - return $this->canDelete(($comment->userID == WCF::getUser()->userID)); + return $this->canDelete($comment->userID == WCF::getUser()->userID); } /** * @inheritDoc */ public function canDeleteResponse(CommentResponse $response) { - return $this->canDelete(($response->userID == WCF::getUser()->userID)); + return $this->canDelete($response->userID == WCF::getUser()->userID); } /** diff --git a/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php index fbd763d392..51452adc11 100644 --- a/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php @@ -27,7 +27,7 @@ class AttachmentCleanUpCronjob extends AbstractCronjob { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ 0, - (TIME_NOW - 86400) + TIME_NOW - 86400 ]); $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php index 98af50a47c..dae33cf020 100644 --- a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php @@ -83,7 +83,7 @@ class CronjobScheduler extends SingletonFactory { // get time of next execution $nextExec = $cronjobEditor->getNextExec(); - $afterNextExec = $cronjobEditor->getNextExec(($nextExec + 120)); + $afterNextExec = $cronjobEditor->getNextExec($nextExec + 120); // mark cronjob as done $cronjobEditor->update([ @@ -177,7 +177,7 @@ class CronjobScheduler extends SingletonFactory { } // verify class signature - if (!(is_subclass_of($className, ICronjob::class))) { + if (!is_subclass_of($className, ICronjob::class)) { throw new ImplementationException($className, ICronjob::class); } diff --git a/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php index e37e0942e9..9448d686c8 100644 --- a/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php @@ -35,7 +35,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ floor($row['searches'] / 4), - (TIME_NOW - 86400 * 30) + TIME_NOW - 86400 * 30 ]); } @@ -44,7 +44,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE time < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400 * USER_CLEANUP_NOTIFICATION_LIFETIME) + TIME_NOW - 86400 * USER_CLEANUP_NOTIFICATION_LIFETIME ]); // clean up user activity events @@ -52,7 +52,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE time < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400 * USER_CLEANUP_ACTIVITY_EVENT_LIFETIME) + TIME_NOW - 86400 * USER_CLEANUP_ACTIVITY_EVENT_LIFETIME ]); // clean up profile visitors @@ -60,7 +60,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE time < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400 * USER_CLEANUP_PROFILE_VISITOR_LIFETIME) + TIME_NOW - 86400 * USER_CLEANUP_PROFILE_VISITOR_LIFETIME ]); // tracked visits @@ -95,7 +95,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE execTime < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - (86400 * 7)) + TIME_NOW - (86400 * 7) ]); // clean up session access log @@ -107,7 +107,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { )"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - (86400 * 30)) + TIME_NOW - (86400 * 30) ]); // clean up session log @@ -115,7 +115,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE lastActivityTime < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - (86400 * 30)) + TIME_NOW - (86400 * 30) ]); // clean up search data @@ -123,7 +123,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE searchTime < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400) + TIME_NOW - 86400 ]); // clean up expired edit history entries @@ -133,7 +133,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE obsoletedAt < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400 * EDIT_HISTORY_EXPIRATION) + TIME_NOW - 86400 * EDIT_HISTORY_EXPIRATION ]); } } @@ -150,7 +150,7 @@ class DailyCleanUpCronjob extends AbstractCronjob { WHERE time < ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - (TIME_NOW - 86400 * USER_AUTHENTICATION_FAILURE_EXPIRATION) + TIME_NOW - 86400 * USER_AUTHENTICATION_FAILURE_EXPIRATION ]); } diff --git a/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php index 6fb45d5335..8727fb74a9 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php @@ -28,7 +28,7 @@ class ModerationQueueCronjob extends AbstractCronjob { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ ModerationQueue::STATUS_DONE, - (TIME_NOW - (86400 * 30)) + TIME_NOW - (86400 * 30) ]); $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php index 040b5814f3..f83593e719 100644 --- a/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php @@ -26,7 +26,7 @@ class UserQuitCronjob extends AbstractCronjob { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ 0, - (TIME_NOW - 7 * 24 * 3600) + TIME_NOW - 7 * 24 * 3600 ]); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index 25336371a4..7ee0bf09bd 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -40,12 +40,12 @@ class MySQLDatabaseEditor extends DatabaseEditor { $typeMatches = $regex->getMatches(); $columns[] = ['name' => $row['Field'], 'data' => [ - 'type' => ((empty($typeMatches)) ? $row['Type'] : $typeMatches[1]), - 'length' => ((empty($typeMatches)) ? '' : $typeMatches[2]), - 'notNull' => (($row['Null'] == 'YES') ? false : true), - 'key' => (($row['Key'] == 'PRI') ? 'PRIMARY' : (($row['Key'] == 'UNI') ? 'UNIQUE' : '')), + 'type' => empty($typeMatches) ? $row['Type'] : $typeMatches[1], + 'length' => empty($typeMatches) ? '' : $typeMatches[2], + 'notNull' => ($row['Null'] == 'YES') ? false : true, + 'key' => ($row['Key'] == 'PRI') ? 'PRIMARY' : (($row['Key'] == 'UNI') ? 'UNIQUE' : ''), 'default' => $row['Default'], - 'autoIncrement' => ($row['Extra'] == 'auto_increment' ? true : false) + 'autoIncrement' => $row['Extra'] == 'auto_increment' ? true : false ]]; } diff --git a/wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php b/wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php index 0bf554cfcd..e55945fbe1 100644 --- a/wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php +++ b/wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php @@ -202,7 +202,7 @@ class PreparedStatement { public function fetchMap($keyColumn, $valueColumn, $uniqueKey = true) { $map = []; - while (($row = $this->fetchArray())) { + while ($row = $this->fetchArray()) { $key = $row[$keyColumn]; $value = $row[$valueColumn]; diff --git a/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php b/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php index e9a605f185..875ea5470b 100644 --- a/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php +++ b/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php @@ -74,9 +74,9 @@ class SQLParser { $columnType = strtolower($matches[2][$i]); $column['data'] = [ 'type' => $columnType, - 'notNull' => ((!empty($matches[4][$i]) && strtoupper($matches[4][$i]) == 'NOT NULL') ? true : false), + 'notNull' => (!empty($matches[4][$i]) && strtoupper($matches[4][$i]) == 'NOT NULL') ? true : false, 'default' => $matches[5][$i], - 'autoIncrement' => (!empty($matches[6][$i]) ? true : false), + 'autoIncrement' => !empty($matches[6][$i]) ? true : false, 'key' => strtoupper($matches[7][$i]) ]; if (!empty($matches[3][$i])) { @@ -133,10 +133,10 @@ class SQLParser { $columnType = strtolower($match[6]); $columnData = [ 'type' => $columnType, - 'notNull' => ((!empty($match[8]) && strtoupper($match[8]) == 'NOT NULL') ? true : false), - 'default' => (isset($match[9]) ? $match[9] : ''), - 'autoIncrement' => (!empty($match[10]) ? true : false), - 'key' => (!empty($match[11]) ? strtoupper($match[11]) : '') + 'notNull' => (!empty($match[8]) && strtoupper($match[8]) == 'NOT NULL') ? true : false, + 'default' => isset($match[9]) ? $match[9] : '', + 'autoIncrement' => !empty($match[10]) ? true : false, + 'key' => !empty($match[11]) ? strtoupper($match[11]) : '' ]; if (!empty($match[7])) { if ($columnType == 'enum') $columnData['values'] = $match[7]; diff --git a/wcfsetup/install/files/lib/system/email/Email.class.php b/wcfsetup/install/files/lib/system/email/Email.class.php index 41122c8a13..4b50aa39bc 100644 --- a/wcfsetup/install/files/lib/system/email/Email.class.php +++ b/wcfsetup/install/files/lib/system/email/Email.class.php @@ -92,7 +92,7 @@ class Email { */ public static function getHost() { if (self::$host === null) { - self::$host = (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : ''; + self::$host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; if (empty(self::$host)) { self::$host = gethostname(); if (self::$host === false) { diff --git a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php index f9ce4c1356..4ceb8d86b9 100644 --- a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php @@ -28,7 +28,7 @@ class SessionAccessLogListener implements IParameterizedEventListener { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ WCF::getSession()->sessionID, - (TIME_NOW - SESSION_TIMEOUT) + TIME_NOW - SESSION_TIMEOUT ]); $row = $statement->fetchArray(); if (!empty($row['sessionLogID'])) { diff --git a/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php index 18c193edfd..2b370d6583 100644 --- a/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php @@ -99,7 +99,7 @@ abstract class AbstractFormElement implements IFormElement { * @return string */ protected function getErrorClass() { - return ($this->getError()) ? ' class="formError"' : ''; + return $this->getError() ? ' class="formError"' : ''; } /** @@ -108,6 +108,6 @@ abstract class AbstractFormElement implements IFormElement { * @return string */ protected function getErrorField() { - return ($this->getError()) ? ''.$this->getError().'' : ''; + return $this->getError() ? ''.$this->getError().'' : ''; } } diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php index c534df2415..2980b210e6 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php @@ -24,7 +24,7 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode { * @inheritDoc */ public function isAllowed(AbstractHtmlNodeProcessor $nodeProcessor) { - return (BBCodeHandler::getInstance()->isAvailableBBCode('img')) ? [] : ['img']; + return BBCodeHandler::getInstance()->isAvailableBBCode('img') ? [] : ['img']; } /** diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php index e3e46b7ee5..7542af6d1d 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php @@ -82,7 +82,7 @@ class HtmlInputNodeWoltlabMetacode extends AbstractHtmlInputNode { $attributes = $htmlNodeProcessor->parseAttributes($element->getAttribute('data-attributes')); // check for converters - $converter = (isset($converters[$name])) ? $converters[$name] : null; + $converter = isset($converters[$name]) ? $converters[$name] : null; if ($converter === null) { $className = 'wcf\\system\\html\\metacode\\converter\\' . $name . 'MetacodeConverter'; if (class_exists($className)) { @@ -98,7 +98,7 @@ class HtmlInputNodeWoltlabMetacode extends AbstractHtmlInputNode { $bbcode = BBCodeCache::getInstance()->getBBCodeByTag($name); if ($bbcode !== null) { $bbcodeAttributes = $bbcode->getAttributes(); - $attr = (isset($bbcodeAttributes[0])) ? $bbcodeAttributes[0] : null; + $attr = isset($bbcodeAttributes[0]) ? $bbcodeAttributes[0] : null; if ($attr !== null && $attr->useText && !empty($attributes[0]) && StringUtil::trim($attributes[0]) == StringUtil::trim($element->textContent)) { // discard content as it is already present in the first attribute diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php index 0028740a49..7bbe708778 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php @@ -372,7 +372,7 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { throw new \InvalidArgumentException("Must provide an existing element for start node or end node, both cannot be null."); } - $element = ($startNode) ? $startNode->ownerDocument->createElement('woltlab-metacode') : $endNode->ownerDocument->createElement('woltlab-metacode'); + $element = $startNode ? $startNode->ownerDocument->createElement('woltlab-metacode') : $endNode->ownerDocument->createElement('woltlab-metacode'); $element->setAttribute('data-name', $name); $element->setAttribute('data-attributes', $attributes); @@ -442,12 +442,12 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { /** @var \DOMElement $end */ $end = $pair['close']; - $attributes = (isset($pair['attributes'])) ? $pair['attributes'] : ''; - $textNode = $start->ownerDocument->createTextNode(($pair['openSource']) ?: HtmlBBCodeParser::getInstance()->buildBBCodeTag($name, $attributes, true)); + $attributes = isset($pair['attributes']) ? $pair['attributes'] : ''; + $textNode = $start->ownerDocument->createTextNode($pair['openSource'] ?: HtmlBBCodeParser::getInstance()->buildBBCodeTag($name, $attributes, true)); DOMUtil::insertBefore($textNode, $start); DOMUtil::removeNode($start); - $textNode = $end->ownerDocument->createTextNode(($pair['closeSource']) ?: '[/' . $name . ']'); + $textNode = $end->ownerDocument->createTextNode($pair['closeSource'] ?: '[/' . $name . ']'); DOMUtil::insertBefore($textNode, $end); DOMUtil::removeNode($end); } diff --git a/wcfsetup/install/files/lib/system/html/metacode/converter/QuoteMetacodeConverter.class.php b/wcfsetup/install/files/lib/system/html/metacode/converter/QuoteMetacodeConverter.class.php index 0766b7b904..010536d708 100644 --- a/wcfsetup/install/files/lib/system/html/metacode/converter/QuoteMetacodeConverter.class.php +++ b/wcfsetup/install/files/lib/system/html/metacode/converter/QuoteMetacodeConverter.class.php @@ -16,8 +16,8 @@ class QuoteMetacodeConverter extends AbstractMetacodeConverter { */ public function convert(\DOMDocumentFragment $fragment, array $attributes) { $element = $fragment->ownerDocument->createElement('blockquote'); - $element->setAttribute('data-quote-title', (isset($attributes[0])) ? $attributes[0] : ''); - $element->setAttribute('data-quote-url', (isset($attributes[1])) ? $attributes[1] : ''); + $element->setAttribute('data-quote-title', isset($attributes[0]) ? $attributes[0] : ''); + $element->setAttribute('data-quote-url', isset($attributes[1]) ? $attributes[1] : ''); $element->appendChild($fragment); return $element; diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php index 3cca230328..a9e7268ea1 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php @@ -52,7 +52,7 @@ class HtmlOutputNodePre extends AbstractHtmlOutputNode { 'content' => $element->textContent, 'file' => $element->getAttribute('data-file'), 'highlighter' => $element->getAttribute('data-highlighter'), - 'line' => ($element->hasAttribute('data-line')) ? $element->getAttribute('data-line') : 1 + 'line' => $element->hasAttribute('data-line') ? $element->getAttribute('data-line') : 1 ]); $htmlNodeProcessor->renameTag($element, 'wcfNode-' . $nodeIdentifier); diff --git a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php index d793d290b7..1cefdc211a 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php @@ -373,7 +373,7 @@ class GDImageAdapter implements IImageAdapter { */ public function rotate($degrees) { // imagerotate interpretes degrees as counter-clockwise - return imagerotate($this->image, (360.0 - $degrees), ($this->color ?: 0)); + return imagerotate($this->image, 360.0 - $degrees, ($this->color ?: 0)); } /** diff --git a/wcfsetup/install/files/lib/system/io/GZipFile.class.php b/wcfsetup/install/files/lib/system/io/GZipFile.class.php index 22d8745dec..e62d1a854c 100644 --- a/wcfsetup/install/files/lib/system/io/GZipFile.class.php +++ b/wcfsetup/install/files/lib/system/io/GZipFile.class.php @@ -31,7 +31,7 @@ class GZipFile extends File { */ public function __construct($filename, $mode = 'wb') { if (self::$gzopen64 === null) { - self::$gzopen64 = (function_exists('gzopen64')); + self::$gzopen64 = function_exists('gzopen64'); } $this->filename = $filename; diff --git a/wcfsetup/install/files/lib/system/io/Tar.class.php b/wcfsetup/install/files/lib/system/io/Tar.class.php index e560bcdc8f..2c27f1b973 100644 --- a/wcfsetup/install/files/lib/system/io/Tar.class.php +++ b/wcfsetup/install/files/lib/system/io/Tar.class.php @@ -187,7 +187,7 @@ class Tar implements IArchive { } if (($header['size'] % 512) != 0) { $buffer = $this->file->read(512); - $content .= substr($buffer, 0, ($header['size'] % 512)); + $content .= substr($buffer, 0, $header['size'] % 512); } return $content; @@ -276,7 +276,7 @@ class Tar implements IArchive { $i++; } - $this->file->seek($this->file->tell() + (512 * ceil(($header['size'] / 512)))); + $this->file->seek($this->file->tell() + (512 * ceil($header['size'] / 512))); } } diff --git a/wcfsetup/install/files/lib/system/io/TarWriter.class.php b/wcfsetup/install/files/lib/system/io/TarWriter.class.php index 2f1fb15983..5a65b1364a 100644 --- a/wcfsetup/install/files/lib/system/io/TarWriter.class.php +++ b/wcfsetup/install/files/lib/system/io/TarWriter.class.php @@ -70,7 +70,7 @@ class TarWriter extends Tar { } $i = 0; - while (($buffer = substr($string, (($i++) * 512), 512)) != '') { + while (($buffer = substr($string, ($i++) * 512, 512)) != '') { $this->file->write(pack('a512', $buffer)); } @@ -280,7 +280,7 @@ class TarWriter extends Tar { $this->file->write($binaryDataLast, 356); $i = 0; - while (($buffer = substr($filename, (($i++) * 512), 512)) != '') { + while (($buffer = substr($filename, ($i++) * 512, 512)) != '') { $this->file->write(pack('a512', $buffer)); } diff --git a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php index 8ff08fcdac..c428911fc5 100644 --- a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php @@ -127,7 +127,7 @@ abstract class AbstractLabelObjectHandler extends SingletonFactory implements IL if ($legacyReturnValue) { // WCF 2.0: boolean true/false - return (empty($validationErrors)); + return empty($validationErrors); } else { // WCF 2.1+: detailed error report (empty array if validation passed) diff --git a/wcfsetup/install/files/lib/system/language/I18nHandler.class.php b/wcfsetup/install/files/lib/system/language/I18nHandler.class.php index e9a90dccaf..8e134400bb 100644 --- a/wcfsetup/install/files/lib/system/language/I18nHandler.class.php +++ b/wcfsetup/install/files/lib/system/language/I18nHandler.class.php @@ -307,7 +307,7 @@ class I18nHandler extends SingletonFactory { $statement->execute([ $languageID, $languageVariable, - (isset($this->i18nValues[$elementID]) ? $this->i18nValues[$elementID][$languageID] : $this->plainValues[$elementID]), + isset($this->i18nValues[$elementID]) ? $this->i18nValues[$elementID][$languageID] : $this->plainValues[$elementID], 0, $languageCategoryID, $packageID @@ -325,7 +325,7 @@ class I18nHandler extends SingletonFactory { foreach ($updateLanguageIDs as $languageID) { $statement->execute([ - (isset($this->i18nValues[$elementID]) ? $this->i18nValues[$elementID][$languageID] : $this->plainValues[$elementID]), + isset($this->i18nValues[$elementID]) ? $this->i18nValues[$elementID][$languageID] : $this->plainValues[$elementID], 0, $languageItemIDs[$languageID] ]); diff --git a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php index a2e916707b..ed7a2cb002 100644 --- a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php +++ b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php @@ -252,7 +252,7 @@ class LikeHandler extends SingletonFactory { $likeObject = LikeObjectEditor::create([ 'objectTypeID' => $likeable->getObjectType()->objectTypeID, 'objectID' => $likeable->getObjectID(), - 'objectUserID' => ($likeable->getUserID() ?: null), + 'objectUserID' => $likeable->getUserID() ?: null, 'likes' => ($likeValue == Like::LIKE) ? 1 : 0, 'dislikes' => ($likeValue == Like::DISLIKE) ? 1 : 0, 'cumulativeLikes' => $cumulativeLikes, @@ -265,7 +265,7 @@ class LikeHandler extends SingletonFactory { if ($like->likeID) { $userEditor = new UserEditor(new User($likeable->getUserID())); $userEditor->updateCounters([ - 'likesReceived' => ($like->likeValue == Like::LIKE ? -1 : 1) + 'likesReceived' => $like->likeValue == Like::LIKE ? -1 : 1 ]); } else if ($likeValue == Like::LIKE) { @@ -281,7 +281,7 @@ class LikeHandler extends SingletonFactory { $like = LikeEditor::create([ 'objectID' => $likeable->getObjectID(), 'objectTypeID' => $likeable->getObjectType()->objectTypeID, - 'objectUserID' => ($likeable->getUserID() ?: null), + 'objectUserID' => $likeable->getUserID() ?: null, 'userID' => $user->userID, 'time' => $time, 'likeValue' => $likeValue diff --git a/wcfsetup/install/files/lib/system/mail/Mail.class.php b/wcfsetup/install/files/lib/system/mail/Mail.class.php index 6a2f2b04cb..d1f65e06fc 100644 --- a/wcfsetup/install/files/lib/system/mail/Mail.class.php +++ b/wcfsetup/install/files/lib/system/mail/Mail.class.php @@ -436,7 +436,7 @@ class Mail { * @param string $name filename */ public function addAttachment($path, $name = '') { - $this->attachments[] = ['path' => $path, 'name' => ($name ?: basename($path))]; + $this->attachments[] = ['path' => $path, 'name' => $name ?: basename($path)]; } /** diff --git a/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php b/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php index c529f91fc7..1c04587625 100644 --- a/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php +++ b/wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php @@ -63,7 +63,7 @@ class SMTPMailSender extends MailSender { throw new SystemException($this->formatError("can not connect to '".MAIL_SMTP_HOST.":".MAIL_SMTP_PORT."'")); } - $host = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : ''; + $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; if (empty($host)) { $host = gethostname(); if ($host === false) { @@ -203,7 +203,7 @@ class SMTPMailSender extends MailSender { throw new SystemException($this->formatError("smtp error")); } - $serverName = (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : ''; + $serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; if (empty($serverName)) { $serverName = gethostname(); if ($serverName === false) { diff --git a/wcfsetup/install/files/lib/system/menu/TreeMenu.class.php b/wcfsetup/install/files/lib/system/menu/TreeMenu.class.php index 0c7ad2332c..62216db2b8 100644 --- a/wcfsetup/install/files/lib/system/menu/TreeMenu.class.php +++ b/wcfsetup/install/files/lib/system/menu/TreeMenu.class.php @@ -187,7 +187,7 @@ abstract class TreeMenu extends SingletonFactory { */ public function getActiveMenuItem($level = 0) { if ($level < count($this->activeMenuItems)) { - return $this->activeMenuItems[(count($this->activeMenuItems) - ($level + 1))]; + return $this->activeMenuItems[count($this->activeMenuItems) - ($level + 1)]; } return null; } diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php index 14cdda8909..0093a7e058 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php @@ -44,7 +44,7 @@ class CommentUserProfileMenuContent extends SingletonFactory implements IUserPro 'commentObjectTypeID' => $this->objectTypeID, 'userID' => $userID, 'lastCommentTime' => $commentList->getMinCommentTime(), - 'likeData' => (MODULE_LIKE ? $commentList->getLikeData() : []) + 'likeData' => MODULE_LIKE ? $commentList->getLikeData() : [] ]); return WCF::getTPL()->fetch('userProfileCommentList'); diff --git a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php index 96e1ea3ad0..e192eba93c 100644 --- a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php +++ b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php @@ -114,17 +114,17 @@ class QuickReplyManager extends SingletonFactory { throw new UserInputException('message', WCF::getLanguage()->get('wcf.global.form.error.empty')); } - $parameters['lastPostTime'] = (isset($parameters['lastPostTime'])) ? intval($parameters['lastPostTime']) : 0; + $parameters['lastPostTime'] = isset($parameters['lastPostTime']) ? intval($parameters['lastPostTime']) : 0; if (!$parameters['lastPostTime']) { throw new UserInputException('lastPostTime'); } - $parameters['pageNo'] = (isset($parameters['pageNo'])) ? intval($parameters['pageNo']) : 0; + $parameters['pageNo'] = isset($parameters['pageNo']) ? intval($parameters['pageNo']) : 0; if (!$parameters['pageNo']) { throw new UserInputException('pageNo'); } - $parameters['objectID'] = (isset($parameters['objectID'])) ? intval($parameters['objectID']) : 0; + $parameters['objectID'] = isset($parameters['objectID']) ? intval($parameters['objectID']) : 0; if (!$parameters['objectID']) { throw new UserInputException('objectID'); } @@ -240,7 +240,7 @@ class QuickReplyManager extends SingletonFactory { // 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 = new $containerActionClassName([$this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container], 'markAsRead'); $containerAction->executeAction(); } diff --git a/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php b/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php index a5ec9618e3..7dfc6b3600 100644 --- a/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php +++ b/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php @@ -128,7 +128,7 @@ class Censorship extends SingletonFactory { if ($position + mb_strlen($word) < mb_strlen($censoredWord)) { // look ahead - if (($newIndex = $this->lookAhead($i + 1, mb_substr($censoredWord, $position + mb_strlen($word))))) { + if ($newIndex = $this->lookAhead($i + 1, mb_substr($censoredWord, $position + mb_strlen($word)))) { $i = $newIndex; } else { @@ -173,7 +173,7 @@ class Censorship extends SingletonFactory { return true; } else if (mb_strpos($search, $this->words[$index]) === (mb_strlen($search) - mb_strlen($this->words[$index]))) { - return $this->lookBehind($index - 1, mb_substr($search, 0, (mb_strlen($search) - mb_strlen($this->words[$index])))); + return $this->lookBehind($index - 1, mb_substr($search, 0, mb_strlen($search) - mb_strlen($this->words[$index]))); } } diff --git a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php index 68c2b86c50..e4cdb4d944 100644 --- a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php +++ b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php @@ -77,9 +77,9 @@ class MessageQuoteManager extends SingletonFactory { // load stored quotes from session $messageQuotes = WCF::getSession()->getVar('__messageQuotes'.$this->packageID); if (is_array($messageQuotes)) { - $this->quotes = (isset($messageQuotes['quotes'])) ? $messageQuotes['quotes'] : []; - $this->quoteData = (isset($messageQuotes['quoteData'])) ? $messageQuotes['quoteData'] : []; - $this->removeQuoteIDs = (isset($messageQuotes['removeQuoteIDs'])) ? $messageQuotes['removeQuoteIDs'] : []; + $this->quotes = isset($messageQuotes['quotes']) ? $messageQuotes['quotes'] : []; + $this->quoteData = isset($messageQuotes['quoteData']) ? $messageQuotes['quoteData'] : []; + $this->removeQuoteIDs = isset($messageQuotes['removeQuoteIDs']) ? $messageQuotes['removeQuoteIDs'] : []; } // load object types diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php index 57d88e6e0b..53fbdb2fbb 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php @@ -96,7 +96,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement 'objectTypeID' => $objectTypeID, 'objectID' => $objectID, 'containerID' => $containerID, - 'userID' => (WCF::getUser()->userID ?: null), + 'userID' => WCF::getUser()->userID ?: null, 'time' => TIME_NOW, 'additionalData' => serialize($additionalData) ] @@ -108,7 +108,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement 'data' => [ 'status' => ModerationQueue::STATUS_OUTSTANDING, 'containerID' => $containerID, - 'userID' => (WCF::getUser()->userID ?: null), + 'userID' => WCF::getUser()->userID ?: null, 'time' => TIME_NOW, 'additionalData' => serialize($additionalData) ] diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index de8714f2b4..805697a66c 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -326,7 +326,7 @@ class ModerationQueueManager extends SingletonFactory { $statement->execute([ $queueID, WCF::getUser()->userID, - ($isAffected ? 1 : 0) + $isAffected ? 1 : 0 ]); } WCF::getDB()->commitTransaction(); diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php index 461b8eae56..b0a54aee6c 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php @@ -156,7 +156,7 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager { 'objectTypeID' => $objectTypeID, 'objectID' => $objectID, 'containerID' => $containerID, - 'userID' => (WCF::getUser()->userID ?: null), + 'userID' => WCF::getUser()->userID ?: null, 'time' => TIME_NOW, 'additionalData' => serialize($additionalData) ] @@ -168,7 +168,7 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager { 'data' => [ 'status' => ModerationQueue::STATUS_OUTSTANDING, 'containerID' => $containerID, - 'userID' => (WCF::getUser()->userID ?: null), + 'userID' => WCF::getUser()->userID ?: null, 'time' => TIME_NOW, 'additionalData' => serialize($additionalData) ] diff --git a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php index 7cd1006414..745e9e5ece 100644 --- a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php @@ -40,7 +40,7 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType WCF::getTPL()->assign([ 'categoryList' => $categoryList, 'option' => $option, - 'value' => (!is_array($value) ? explode("\n", $value) : $value) + 'value' => !is_array($value) ? explode("\n", $value) : $value ]); return WCF::getTPL()->fetch('categoryMultiSelectOptionType'); } diff --git a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php index 21dde661de..0dd6d67cd2 100644 --- a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php @@ -90,6 +90,6 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt return 0; } - return ($value1) ? 1 : -1; + return $value1 ? 1 : -1; } } diff --git a/wcfsetup/install/files/lib/system/option/MessageOptionType.class.php b/wcfsetup/install/files/lib/system/option/MessageOptionType.class.php index cf2ab8e66e..eece0748b5 100644 --- a/wcfsetup/install/files/lib/system/option/MessageOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/MessageOptionType.class.php @@ -37,7 +37,7 @@ class MessageOptionType extends TextareaOptionType { throw new \RuntimeException("Message object type '".$option->optionName."' requires an object type for definition 'com.woltlab.wcf.message'."); } - $permission = ($option->disallowedbbcodepermission) ?: 'user.message.disallowedBBCodes'; + $permission = $option->disallowedbbcodepermission ?: 'user.message.disallowedBBCodes'; BBCodeHandler::getInstance()->setDisallowedBBCodes(explode(',', ArrayUtil::trim(WCF::getSession()->getPermission($permission)))); $this->htmlInputProcessor = new HtmlInputProcessor(); @@ -53,7 +53,7 @@ class MessageOptionType extends TextareaOptionType { * @inheritDoc */ public function getFormElement(Option $option, $value) { - $permission = ($option->disallowedbbcodepermission) ?: 'user.message.disallowedBBCodes'; + $permission = $option->disallowedbbcodepermission ?: 'user.message.disallowedBBCodes'; BBCodeHandler::getInstance()->setDisallowedBBCodes(explode(',', ArrayUtil::trim(WCF::getSession()->getPermission($permission)))); WCF::getTPL()->assign([ diff --git a/wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php index f87a9a86dd..52c6948606 100644 --- a/wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php @@ -36,7 +36,7 @@ class MultiSelectOptionType extends SelectOptionType { WCF::getTPL()->assign([ 'option' => $option, 'selectOptions' => $this->getSelectOptions($option), - 'value' => (!is_array($value) ? explode("\n", $value) : $value) + 'value' => !is_array($value) ? explode("\n", $value) : $value ]); return WCF::getTPL()->fetch($this->formElementTemplate); } @@ -49,7 +49,7 @@ class MultiSelectOptionType extends SelectOptionType { 'option' => $option, 'searchOption' => $value !== null && ($value !== $option->defaultValue || isset($_POST['searchOptions'][$option->optionName])), 'selectOptions' => $this->getSelectOptions($option), - 'value' => (!is_array($value) ? explode("\n", $value) : $value) + 'value' => !is_array($value) ? explode("\n", $value) : $value ]); return WCF::getTPL()->fetch($this->searchableFormElementTemplate); } diff --git a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php index cd0631b773..c2c08195a6 100644 --- a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php @@ -277,7 +277,7 @@ class OptionHandler implements IOptionHandler { return [ 'object' => $option, - 'value' => (isset($this->optionValues[$option->optionName]) ? $this->optionValues[$option->optionName] : null), + 'value' => isset($this->optionValues[$option->optionName]) ? $this->optionValues[$option->optionName] : null, 'html' => $html, 'cssClassName' => $this->getTypeObject($option->optionType)->getCSSClassName(), 'hideLabelInSearch' => $this->getTypeObject($option->optionType)->hideLabelInSearch() diff --git a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php index 8cbdacc9a9..6500291652 100644 --- a/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/SelectOptionType.class.php @@ -27,7 +27,7 @@ class SelectOptionType extends RadioButtonOptionType { 'option' => $option, 'selectOptions' => $this->getSelectOptions($option), 'value' => $value, - 'allowEmptyValue' => ($this->allowEmptyValue || $option->allowEmptyValue) + 'allowEmptyValue' => $this->allowEmptyValue || $option->allowEmptyValue ]); return WCF::getTPL()->fetch('selectOptionType'); } diff --git a/wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php b/wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php index 435a7509ad..efd9f3c885 100644 --- a/wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php @@ -26,7 +26,7 @@ class TimezoneOptionType extends AbstractOptionType { WCF::getTPL()->assign([ 'option' => $option, 'selectOptions' => $timezoneOptions, - 'value' => ($value ?: TIMEZONE) + 'value' => $value ?: TIMEZONE ]); return WCF::getTPL()->fetch('selectOptionType'); } diff --git a/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php index 487c01872f..89a66ab8b9 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php @@ -78,8 +78,8 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG * @inheritDoc */ public function compare($value1, $value2) { - $value1 = ($value1) ? explode(',', $value1) : []; - $value2 = ($value2) ? explode(',', $value2) : []; + $value1 = $value1 ? explode(',', $value1) : []; + $value2 = $value2 ? explode(',', $value2) : []; // check if value1 contains more elements than value2 $diff = array_diff($value1, $value2); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 23f087dc76..62dfd3336a 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -419,7 +419,7 @@ class PackageInstallationDispatcher { $statement->execute([ $this->queue->packageID, $excludedPackage['name'], - (!empty($excludedPackage['version']) ? $excludedPackage['version'] : '') + !empty($excludedPackage['version']) ? $excludedPackage['version'] : '' ]); } } @@ -707,7 +707,7 @@ class PackageInstallationDispatcher { $directory = WCF::getSession()->getVar('__wcfSetup_directories'); if ($directory !== null) { $abbreviation = Package::getAbbreviation($this->getPackage()->package); - $directory = (isset($directory[$abbreviation])) ? $directory[$abbreviation] : null; + $directory = isset($directory[$abbreviation]) ? $directory[$abbreviation] : null; } if ($directory === null && !PackageInstallationFormManager::findForm($this->queue, 'packageDir')) { @@ -1008,7 +1008,7 @@ class PackageInstallationDispatcher { // validate extensions if (isset($requirements['extensions'])) { foreach ($requirements['extensions'] as $extension) { - $passed = (extension_loaded($extension)) ? true : false; + $passed = extension_loaded($extension) ? true : false; if (!$passed) { $errors['extension'][] = [ @@ -1116,7 +1116,7 @@ class PackageInstallationDispatcher { // handle values considered as 'true' if (in_array($value, $trueValues)) { - return ($compareValue) ? true : false; + return $compareValue ? true : false; } // handle values considered as 'false' else if (in_array($value, $falseValues)) { diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php index 8a677df00a..d653a892f6 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php @@ -20,7 +20,7 @@ abstract class PackageInstallationFormManager { * @param PackageInstallationQueue $queue */ public static function handleRequest(PackageInstallationQueue $queue) { - $formName = (isset($_REQUEST['formName'])) ? StringUtil::trim($_REQUEST['formName']) : ''; + $formName = isset($_REQUEST['formName']) ? StringUtil::trim($_REQUEST['formName']) : ''; // ignore request if (empty($formName) || !self::findForm($queue, $formName)) return; diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index 7325c5e93a..6c474d238f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -449,7 +449,7 @@ class PackageInstallationNodeBuilder { // requirements will be checked once package is about to be installed $this->requirements[$packageName] = [ - 'minVersion' => (isset($package['minversion'])) ? $package['minversion'] : '', + 'minVersion' => isset($package['minversion']) ? $package['minversion'] : '', 'packageID' => $package['packageID'] ]; @@ -521,7 +521,7 @@ class PackageInstallationNodeBuilder { 'packageID' => $packageID, 'packageName' => $archive->getLocalizedPackageInfo('packageName'), 'archive' => $fileName, - 'action' => ($packageID ? 'update' : 'install') + 'action' => $packageID ? 'update' : 'install' ]); self::$pendingPackages[$archive->getPackageInfo('name')] = $archive->getPackageInfo('version'); diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 4b2855c27b..d7c8997db8 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -117,7 +117,7 @@ class PackageUpdateDispatcher extends SingletonFactory { catch (SystemException $e) { $reply = $request->getReply(); - $statusCode = (is_array($reply['statusCode'])) ? reset($reply['statusCode']) : $reply['statusCode']; + $statusCode = is_array($reply['statusCode']) ? reset($reply['statusCode']) : $reply['statusCode']; // status code 0 is a connection timeout if (!$statusCode && $secureConnection) { if (preg_match('~https?://(?:update|store)\.woltlab\.com~', $updateServer->serverURL)) { @@ -271,7 +271,7 @@ class PackageUpdateDispatcher extends SingletonFactory { foreach ($elements as $element) { $versionNo = $element->getAttribute('name'); $packageInfo['versions'][$versionNo] = [ - 'isAccessible' => ($element->getAttribute('accessible') == 'true' ? true : false) + 'isAccessible' => $element->getAttribute('accessible') == 'true' ? true : false ]; $children = $xpath->query('child::*', $element); @@ -332,7 +332,7 @@ class PackageUpdateDispatcher extends SingletonFactory { case 'license': $packageInfo['versions'][$versionNo]['license'] = [ 'license' => $child->nodeValue, - 'licenseURL' => ($child->hasAttribute('url') ? $child->getAttribute('url') : '') + 'licenseURL' => $child->hasAttribute('url') ? $child->getAttribute('url') : '' ]; break; } @@ -375,9 +375,9 @@ class PackageUpdateDispatcher extends SingletonFactory { // create new database entry $version = PackageUpdateVersionEditor::create([ 'filename' => $packageFile, - 'license' => (isset($versionData['license']['license']) ? $versionData['license']['license'] : ''), - 'licenseURL' => (isset($versionData['license']['license']) ? $versionData['license']['licenseURL'] : ''), - 'isAccessible' => ($versionData['isAccessible'] ? 1 : 0), + 'license' => isset($versionData['license']['license']) ? $versionData['license']['license'] : '', + 'licenseURL' => isset($versionData['license']['license']) ? $versionData['license']['licenseURL'] : '', + 'isAccessible' => $versionData['isAccessible'] ? 1 : 0, 'packageDate' => $versionData['packageDate'], 'packageUpdateID' => $packageUpdateID, 'packageVersion' => $packageVersion @@ -391,7 +391,7 @@ class PackageUpdateDispatcher extends SingletonFactory { $requirementInserts[] = [ 'packageUpdateVersionID' => $packageUpdateVersionID, 'package' => $requiredIdentifier, - 'minversion' => (isset($required['minversion']) ? $required['minversion'] : '') + 'minversion' => isset($required['minversion']) ? $required['minversion'] : '' ]; } } @@ -412,7 +412,7 @@ class PackageUpdateDispatcher extends SingletonFactory { $excludedPackagesParameters[] = [ 'packageUpdateVersionID' => $packageUpdateVersionID, 'excludedPackage' => $excludedIdentifier, - 'excludedPackageVersion' => (isset($exclusion['version']) ? $exclusion['version'] : '') + 'excludedPackageVersion' => isset($exclusion['version']) ? $exclusion['version'] : '' ]; } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php index 6848850d58..a8dceabed2 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php @@ -124,7 +124,7 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati } $data = [ - 'categoryName' => (isset($data['categoryname'])) ? $data['categoryname'] : '', + 'categoryName' => isset($data['categoryname']) ? $data['categoryname'] : '', 'optionName' => $element->getAttribute('name'), 'objectTypeID' => $objectTypeID ]; diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php index 1c46e5d469..4033bef8d6 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php @@ -22,7 +22,7 @@ class ACPMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPl protected function prepareImport(array $data) { $returnValue = parent::prepareImport($data); - $returnValue['icon'] = (isset($data['elements']['icon'])) ? $data['elements']['icon'] : ''; + $returnValue['icon'] = isset($data['elements']['icon']) ? $data['elements']['icon'] : ''; return $returnValue; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php index b174f9a4a2..e82764ba38 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php @@ -42,7 +42,7 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta */ protected function prepareImport(array $data) { // get show order - $showOrder = (isset($data['elements']['showorder'])) ? $data['elements']['showorder'] : null; + $showOrder = isset($data['elements']['showorder']) ? $data['elements']['showorder'] : null; $showOrder = $this->getShowOrder($showOrder); return [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php index 3e05343012..2acbd4d7a2 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php @@ -33,18 +33,18 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI */ protected function prepareImport(array $data) { // adjust show order - $showOrder = (isset($data['elements']['showorder'])) ? $data['elements']['showorder'] : null; - $parent = (isset($data['elements']['parent'])) ? $data['elements']['parent'] : ''; + $showOrder = isset($data['elements']['showorder']) ? $data['elements']['showorder'] : null; + $parent = isset($data['elements']['parent']) ? $data['elements']['parent'] : ''; $showOrder = $this->getShowOrder($showOrder, $parent, 'parentMenuItem'); // merge values and default values return [ 'menuItem' => $data['attributes']['name'], 'menuItemController' => isset($data['elements']['controller']) ? $data['elements']['controller'] : '', - 'menuItemLink' => (isset($data['elements']['link'])) ? $data['elements']['link'] : '', - 'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '', - 'parentMenuItem' => (isset($data['elements']['parent'])) ? $data['elements']['parent'] : '', - 'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : '', + 'menuItemLink' => isset($data['elements']['link']) ? $data['elements']['link'] : '', + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'parentMenuItem' => isset($data['elements']['parent']) ? $data['elements']['parent'] : '', + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '', 'showOrder' => $showOrder ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php index f58f731fb2..c4cfc71186 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php @@ -120,10 +120,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag // build data block with defaults $data = [ 'categoryName' => $element->getAttribute('name'), - 'options' => (isset($data['options'])) ? $data['options'] : '', - 'parentCategoryName' => (isset($data['parent'])) ? $data['parent'] : '', - 'permissions' => (isset($data['permissions'])) ? $data['permissions'] : '', - 'showOrder' => (isset($data['showorder'])) ? intval($data['showorder']) : null + 'options' => isset($data['options']) ? $data['options'] : '', + 'parentCategoryName' => isset($data['parent']) ? $data['parent'] : '', + 'permissions' => isset($data['permissions']) ? $data['permissions'] : '', + 'showOrder' => isset($data['showorder']) ? intval($data['showorder']) : null ]; // adjust show order diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php index 5cb3a7eb87..f88cbb9e55 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php @@ -196,7 +196,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta */ protected function getI18nValues(array $values, $singleValueOnly = false) { if (empty($values)) { - return ($singleValueOnly) ? '' : []; + return $singleValueOnly ? '' : []; } // check for a value with an empty language code and treat it as 'en' unless 'en' exists diff --git a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php index a83098a921..5e6eeef8b8 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php @@ -87,14 +87,14 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug protected function prepareImport(array $data) { $data = [ 'bbcodeTag' => mb_strtolower(StringUtil::trim($data['attributes']['name'])), - 'htmlOpen' => (!empty($data['elements']['htmlopen']) ? $data['elements']['htmlopen'] : ''), - 'htmlClose' => (!empty($data['elements']['htmlclose']) ? $data['elements']['htmlclose'] : ''), - 'wysiwygIcon' => (!empty($data['elements']['wysiwygicon']) ? $data['elements']['wysiwygicon'] : ''), - 'attributes' => (isset($data['elements']['attributes']) ? $data['elements']['attributes'] : []), - 'className' => (!empty($data['elements']['classname']) ? $data['elements']['classname'] : ''), - 'isBlockElement' => (!empty($data['elements']['isBlockElement']) ? 1 : 0), - 'isSourceCode' => (!empty($data['elements']['sourcecode']) ? 1 : 0), - 'buttonLabel' => (isset($data['elements']['buttonlabel']) ? $data['elements']['buttonlabel'] : ''), + 'htmlOpen' => !empty($data['elements']['htmlopen']) ? $data['elements']['htmlopen'] : '', + 'htmlClose' => !empty($data['elements']['htmlclose']) ? $data['elements']['htmlclose'] : '', + 'wysiwygIcon' => !empty($data['elements']['wysiwygicon']) ? $data['elements']['wysiwygicon'] : '', + 'attributes' => isset($data['elements']['attributes']) ? $data['elements']['attributes'] : [], + 'className' => !empty($data['elements']['classname']) ? $data['elements']['classname'] : '', + 'isBlockElement' => !empty($data['elements']['isBlockElement']) ? 1 : 0, + 'isSourceCode' => !empty($data['elements']['sourcecode']) ? 1 : 0, + 'buttonLabel' => isset($data['elements']['buttonlabel']) ? $data['elements']['buttonlabel'] : '', 'originIsSystem' => 1 ]; @@ -171,10 +171,10 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug BBCodeAttributeEditor::create([ 'bbcodeID' => $bbcodeID, 'attributeNo' => $attributeNo, - 'attributeHtml' => (!empty($attribute['html']) ? $attribute['html'] : ''), - 'validationPattern' => (!empty($attribute['validationpattern']) ? $attribute['validationpattern'] : ''), - 'required' => (!empty($attribute['required']) ? $attribute['required'] : 0), - 'useText' => (!empty($attribute['usetext']) ? $attribute['usetext'] : 0) + 'attributeHtml' => !empty($attribute['html']) ? $attribute['html'] : '', + 'validationPattern' => !empty($attribute['validationpattern']) ? $attribute['validationpattern'] : '', + 'required' => !empty($attribute['required']) ? $attribute['required'] : 0, + 'useText' => !empty($attribute['usetext']) ? $attribute['usetext'] : 0 ]); } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php index 7bbd03f959..7cfd9dedca 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php @@ -205,7 +205,7 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin 'position' => $position, 'showOrder' => $this->getItemOrder($position), 'visibleEverywhere' => (!empty($data['elements']['visibleEverywhere'])) ? 1 : 0, - 'isMultilingual' => ($isMultilingual) ? '1' : '0', + 'isMultilingual' => $isMultilingual ? '1' : '0', 'cssClassName' => (!empty($data['elements']['cssClassName'])) ? $data['elements']['cssClassName'] : '', 'showHeader' => (!empty($data['elements']['showHeader'])) ? 1 : 0, 'originIsSystem' => 1, @@ -347,7 +347,7 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin // save page ids foreach ($pageIDs as $pageID) { - $insertStatement->execute([$boxes[$boxIdentifier]->boxID, $pageID, ($boxes[$boxIdentifier]->visibleEverywhere ? 0 : 1)]); + $insertStatement->execute([$boxes[$boxIdentifier]->boxID, $pageID, $boxes[$boxIdentifier]->visibleEverywhere ? 0 : 1]); } } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php index e1b9281f51..e9dd0b7297 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php @@ -70,7 +70,7 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall * @inheritDoc */ protected function prepareImport(array $data) { - $showOrder = (isset($data['elements']['showorder'])) ? intval($data['elements']['showorder']) : null; + $showOrder = isset($data['elements']['showorder']) ? intval($data['elements']['showorder']) : null; $showOrder = $this->getShowOrder($showOrder, $data['elements']['actionclassname'], 'actionClassName'); return [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php index c08658ac34..8403d0ff8c 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php @@ -70,13 +70,13 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu */ protected function prepareImport(array $data) { return [ - 'canBeDisabled' => (isset($data['elements']['canbedisabled'])) ? intval($data['elements']['canbedisabled']) : 1, - 'canBeEdited' => (isset($data['elements']['canbeedited'])) ? intval($data['elements']['canbeedited']) : 1, - 'className' => (isset($data['elements']['classname'])) ? $data['elements']['classname'] : '', - 'cronjobName' => (isset($data['attributes']['name']) ? $data['attributes']['name'] : ''), - 'description' => (isset($data['elements']['description'])) ? $data['elements']['description'] : '', - 'isDisabled' => (isset($data['elements']['isdisabled'])) ? intval($data['elements']['isdisabled']) : 0, - 'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '', + 'canBeDisabled' => isset($data['elements']['canbedisabled']) ? intval($data['elements']['canbedisabled']) : 1, + 'canBeEdited' => isset($data['elements']['canbeedited']) ? intval($data['elements']['canbeedited']) : 1, + 'className' => isset($data['elements']['classname']) ? $data['elements']['classname'] : '', + 'cronjobName' => isset($data['attributes']['name']) ? $data['attributes']['name'] : '', + 'description' => isset($data['elements']['description']) ? $data['elements']['description'] : '', + 'isDisabled' => isset($data['elements']['isdisabled']) ? intval($data['elements']['isdisabled']) : 0, + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', 'startDom' => $data['elements']['startdom'], 'startDow' => $data['elements']['startdow'], 'startHour' => $data['elements']['starthour'], diff --git a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php index 71b4fc78ef..4b9b9fd650 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php @@ -46,10 +46,10 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat if (!isset($item['attributes']['name'])) { $legacyStatement->execute([ $this->installation->getPackageID(), - (isset($item['elements']['environment']) ? $item['elements']['environment'] : 'user'), + isset($item['elements']['environment']) ? $item['elements']['environment'] : 'user', $item['elements']['eventclassname'], $item['elements']['eventname'], - (isset($item['elements']['inherit'])) ? $item['elements']['inherit'] : 0, + isset($item['elements']['inherit']) ? $item['elements']['inherit'] : 0, $item['elements']['listenerclassname'] ]); } @@ -66,20 +66,20 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat * @inheritDoc */ protected function prepareImport(array $data) { - $nice = (isset($data['elements']['nice'])) ? intval($data['elements']['nice']) : 0; + $nice = isset($data['elements']['nice']) ? intval($data['elements']['nice']) : 0; if ($nice < -128) $nice = -128; else if ($nice > 127) $nice = 127; return [ - 'environment' => (isset($data['elements']['environment']) ? $data['elements']['environment'] : 'user'), + 'environment' => isset($data['elements']['environment']) ? $data['elements']['environment'] : 'user', 'eventClassName' => $data['elements']['eventclassname'], 'eventName' => $data['elements']['eventname'], - 'inherit' => (isset($data['elements']['inherit'])) ? intval($data['elements']['inherit']) : 0, + 'inherit' => isset($data['elements']['inherit']) ? intval($data['elements']['inherit']) : 0, 'listenerClassName' => $data['elements']['listenerclassname'], - 'listenerName' => (isset($data['attributes']['name']) ? $data['attributes']['name'] : ''), + 'listenerName' => isset($data['attributes']['name']) ? $data['attributes']['name'] : '', 'niceValue' => $nice, - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : ''), - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '') + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '' ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php index 7eefb822f9..59009aeb40 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php @@ -195,7 +195,7 @@ class MenuItemPackageInstallationPlugin extends AbstractXMLPackageInstallationPl WHERE " . ($parentItemID === null ? 'menuID' : 'parentItemID') . " = ?"; $statement = WCF::getDB()->prepareStatement($sql, 1); $statement->execute([ - ($parentItemID === null ? $menuID : $parentItemID) + $parentItemID === null ? $menuID : $parentItemID ]); $row = $statement->fetchSingleRow(); diff --git a/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php index e86992624f..361b0b7fd4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php @@ -130,8 +130,8 @@ class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin 'name' => $this->getI18nValues($data['elements']['title'], true), 'boxType' => 'menu', 'position' => $position, - 'showHeader' => (!empty($data['elements']['box']['showHeader']) ? 1 : 0), - 'visibleEverywhere' => (!empty($data['elements']['box']['visibleEverywhere']) ? 1 : 0), + 'showHeader' => !empty($data['elements']['box']['showHeader']) ? 1 : 0, + 'visibleEverywhere' => !empty($data['elements']['box']['visibleEverywhere']) ? 1 : 0, 'cssClassName' => (!empty($data['elements']['box']['cssClassName'])) ? $data['elements']['box']['cssClassName'] : '', 'originIsSystem' => 1, 'packageID' => $this->installation->getPackageID() @@ -259,7 +259,7 @@ class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin // save page ids foreach ($pageIDs as $pageID) { - $insertStatement->execute([$box->boxID, $pageID, ($box->visibleEverywhere ? 0 : 1)]); + $insertStatement->execute([$box->boxID, $pageID, $box->visibleEverywhere ? 0 : 1]); } } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php index a41df038f0..0ed2e890a5 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php @@ -43,9 +43,9 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn */ protected function prepareImport(array $data) { return [ - 'interfaceName' => (isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : ''), + 'interfaceName' => isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : '', 'definitionName' => $data['elements']['name'], - 'categoryName' => (isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '') + 'categoryName' => isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '' ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index f6a89dae4f..c5f91875a4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -78,7 +78,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation return [ 'definitionID' => $this->getDefinitionID($data['elements']['definitionname']), 'objectType' => $data['elements']['name'], - 'className' => (isset($data['elements']['classname']) ? $data['elements']['classname'] : ''), + 'className' => isset($data['elements']['classname']) ? $data['elements']['classname'] : '', 'additionalData' => serialize($additionalData) ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php index a63a0c8385..e7f6d9ac0a 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php @@ -45,7 +45,7 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin return [ 'className' => $data['nodeValue'], 'pluginName' => $data['attributes']['name'], - 'priority' => ($this->installation->getPackage()->package == 'com.woltlab.wcf' ? 1 : 0) + 'priority' => $this->installation->getPackage()->package == 'com.woltlab.wcf' ? 1 : 0 ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 66b74e087d..ef0145e799 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -217,8 +217,8 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin 'parentPageID' => $parentPageID, 'applicationPackageID' => $applicationPackageID, 'requireObjectID' => (!empty($data['elements']['requireObjectID'])) ? 1 : 0, - 'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '', - 'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : '', + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '', 'hasFixedParent' => ($pageType == 'system' && !empty($data['elements']['hasFixedParent'])) ? 1 : 0 ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php index d8b72552f9..0c2c288bd9 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php @@ -53,7 +53,7 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug 'smileyCode' => $data['attributes']['name'], 'smileyTitle' => $data['elements']['title'], 'smileyPath' => $data['elements']['path'], - 'aliases' => (isset($data['elements']['aliases']) ? $data['elements']['aliases'] : ''), + 'aliases' => isset($data['elements']['aliases']) ? $data['elements']['aliases'] : '', 'showOrder' => $showOrder ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php index ea7b2ec6b8..dc0079d9cc 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php @@ -57,8 +57,8 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal 'eventName' => $data['elements']['eventname'], 'niceValue' => $niceValue, 'name' => $data['attributes']['name'], - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : ''), - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''), + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '', 'templateCode' => $data['elements']['templatecode'], 'templateName' => $data['elements']['templatename'] ]; diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php index d8c422b839..091399d2ea 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php @@ -76,7 +76,7 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst $data = [ 'categoryName' => $categoryName, 'optionType' => $optionType, - 'defaultValue' => (isset($option['userdefaultvalue']) ? $userDefaultValue : $defaultValue), + 'defaultValue' => isset($option['userdefaultvalue']) ? $userDefaultValue : $defaultValue, 'validationPattern' => $validationPattern, 'showOrder' => $showOrder, 'enableOptions' => $enableOptions, diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php index 698e3bf6f9..a0fb33aa26 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php @@ -79,9 +79,9 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI 'eventName' => $data['elements']['name'], 'className' => $data['elements']['classname'], 'objectTypeID' => $objectTypeID, - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''), - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : ''), - 'preset' => (!empty($data['elements']['preset']) ? 1 : 0), + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '', + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'preset' => !empty($data['elements']['preset']) ? 1 : 0, 'presetMailNotificationType' => $presetMailNotificationType ]; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php index d1cd122d2f..8498ad795e 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php @@ -48,14 +48,14 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected function prepareImport(array $data) { // adjust show order - $showOrder = (isset($data['elements']['showorder'])) ? $data['elements']['showorder'] : null; + $showOrder = isset($data['elements']['showorder']) ? $data['elements']['showorder'] : null; $showOrder = $this->getShowOrder($showOrder); // merge values and default values return [ 'menuItem' => $data['attributes']['name'], - 'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '', - 'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : '', + 'options' => isset($data['elements']['options']) ? $data['elements']['options'] : '', + 'permissions' => isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '', 'showOrder' => $showOrder, 'className' => $data['elements']['classname'] ]; diff --git a/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php index 9b72476814..304a0d270e 100644 --- a/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php @@ -55,7 +55,7 @@ class ArticlePageHandler extends AbstractLookupPageHandler implements IOnlineLoc foreach ($articleList->getObjects() as $article) { $results[] = [ 'description' => $article->getFormattedTeaser(), - 'image' => ($article->getImage() ? $article->getImage()->getElementTag(48) : ''), + 'image' => $article->getImage() ? $article->getImage()->getElementTag(48) : '', 'link' => $article->getLink(), 'objectID' => $article->articleID, 'title' => $article->getTitle() diff --git a/wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php b/wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php index 05427581e5..f75491fe9a 100644 --- a/wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php +++ b/wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php @@ -107,9 +107,9 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType { catch (SystemException $e) { // log failure $action = new PaidSubscriptionTransactionLogAction([], 'create', ['data' => [ - 'subscriptionUserID' => ($userSubscription !== null ? $userSubscription->subscriptionUserID : null), - 'userID' => ($user !== null ? $user->userID : null), - 'subscriptionID' => ($subscription !== null ? $subscription->subscriptionID : null), + 'subscriptionUserID' => $userSubscription !== null ? $userSubscription->subscriptionUserID : null, + 'userID' => $user !== null ? $user->userID : null, + 'subscriptionID' => $subscription !== null ? $subscription->subscriptionID : null, 'paymentMethodObjectTypeID' => $paymentMethodObjectTypeID, 'logTime' => TIME_NOW, 'transactionID' => $transactionID, diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 45daa13883..7643dc2511 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -177,9 +177,9 @@ class PollManager extends SingletonFactory { if (isset($postData['pollQuestion'])) $this->pollData['question'] = StringUtil::trim($postData['pollQuestion']); // boolean values - $this->pollData['isChangeable'] = (isset($postData['pollIsChangeable'])) ? 1 : 0; - $this->pollData['resultsRequireVote'] = (isset($postData['pollResultsRequireVote'])) ? 1 : 0; - $this->pollData['sortByVotes'] = (isset($postData['pollSortByVotes'])) ? 1 : 0; + $this->pollData['isChangeable'] = isset($postData['pollIsChangeable']) ? 1 : 0; + $this->pollData['resultsRequireVote'] = isset($postData['pollResultsRequireVote']) ? 1 : 0; + $this->pollData['sortByVotes'] = isset($postData['pollSortByVotes']) ? 1 : 0; if ($this->poll === null) { $this->pollData['isPublic'] = (isset($postData['pollIsPublic']) && $this->canStartPublicPoll()) ? 1 : 0; @@ -305,7 +305,7 @@ class PollManager extends SingletonFactory { public function assignVariables() { $variables = [ '__showPoll' => true, - 'pollID' => ($this->poll === null ? 0 : $this->poll->pollID), + 'pollID' => $this->poll === null ? 0 : $this->poll->pollID, 'pollOptions' => $this->pollOptions ]; foreach ($this->pollData as $key => $value) { diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index c083072f11..3dbf6e096f 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -281,7 +281,7 @@ class ControllerMap extends SingletonFactory { * @return string[]|null className, controller and pageType, or null if this is not a legacy controller name */ protected function getLegacyClassData($application, $controller, $isAcpRequest) { - $environment = ($isAcpRequest) ? 'acp' : 'frontend'; + $environment = $isAcpRequest ? 'acp' : 'frontend'; if (isset($this->ciControllers['lookup'][$application][$environment][$controller])) { $className = $this->ciControllers['lookup'][$application][$environment][$controller]; diff --git a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php index e4767c0800..178d8986e9 100644 --- a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php @@ -118,7 +118,7 @@ class FlexibleRoute implements IRoute { * @inheritDoc */ public function buildLink(array $components) { - $application = (isset($components['application'])) ? $components['application'] : null; + $application = isset($components['application']) ? $components['application'] : null; // drop application component to avoid being appended as query string unset($components['application']); diff --git a/wcfsetup/install/files/lib/system/request/Route.class.php b/wcfsetup/install/files/lib/system/request/Route.class.php index 440de7c621..345b300a5d 100644 --- a/wcfsetup/install/files/lib/system/request/Route.class.php +++ b/wcfsetup/install/files/lib/system/request/Route.class.php @@ -257,7 +257,7 @@ class Route implements IRoute { * @inheritDoc */ public function buildLink(array $components) { - $application = (isset($components['application'])) ? $components['application'] : null; + $application = isset($components['application']) ? $components['application'] : null; self::loadDefaultControllers(); // drop application component to avoid being appended as query string @@ -367,7 +367,7 @@ class Route implements IRoute { $controllerName = RequestHandler::getTokenizedController($controller); $alias = (!$this->isACP) ? RequestHandler::getInstance()->getAliasByController($controllerName) : null; - self::$controllerNames[$controller] = ($alias) ?: $controllerName; + self::$controllerNames[$controller] = $alias ?: $controllerName; } return self::$controllerNames[$controller]; diff --git a/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php b/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php index cd08e130c8..53b4e83b17 100644 --- a/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php @@ -132,7 +132,7 @@ class DynamicRequestRoute implements IRequestRoute { * @inheritDoc */ public function buildLink(array $components) { - $application = (isset($components['application'])) ? $components['application'] : null; + $application = isset($components['application']) ? $components['application'] : null; // drop application component to avoid being appended as query string unset($components['application']); diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 8d2c6b251e..8ffb725cb8 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -299,7 +299,7 @@ class SessionHandler extends SingletonFactory { 'ipAddress' => UserUtil::getIpAddress(), 'userAgent' => UserUtil::getUserAgent(), 'requestURI' => UserUtil::getRequestURI(), - 'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '') + 'requestMethod' => !empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '' ]; } @@ -570,7 +570,7 @@ class SessionHandler extends SingletonFactory { 'userAgent' => UserUtil::getUserAgent(), 'lastActivityTime' => TIME_NOW, 'requestURI' => UserUtil::getRequestURI(), - 'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '') + 'requestMethod' => !empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '' ]; if ($spiderID !== null) $sessionData['spiderID'] = $spiderID; @@ -783,7 +783,7 @@ class SessionHandler extends SingletonFactory { 'userAgent' => UserUtil::getUserAgent(), 'lastActivityTime' => TIME_NOW, 'requestURI' => UserUtil::getRequestURI(), - 'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '') + 'requestMethod' => !empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '' ]; $this->session = call_user_func([$this->sessionEditorClassName, 'create'], $sessionData); diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index baa38abe7c..6d7d242666 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -302,7 +302,7 @@ class StyleCompiler extends SingletonFactory { if (PACKAGE_ID) { foreach (Option::getOptions() as $constantName => $option) { if (in_array($option->optionType, static::$supportedOptionType)) { - $variables['wcf_option_'.mb_strtolower($constantName)] = (is_int($option->optionValue)) ? $option->optionValue : '"'.$option->optionValue.'"'; + $variables['wcf_option_'.mb_strtolower($constantName)] = is_int($option->optionValue) ? $option->optionValue : '"'.$option->optionValue.'"'; } } } diff --git a/wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php index 8b186729ae..a9e52a86f5 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php @@ -49,7 +49,7 @@ class HascontentPrefilterTemplatePlugin implements IPrefilterTemplatePlugin { $beforeContent = $matches['before']; $content = $matches['content']; $afterContent = $matches['after']; - $elseContent = (isset($matches['else'])) ? $matches['else'] : ''; + $elseContent = isset($matches['else']) ? $matches['else'] : ''; $assignContent = (isset($matches['assign']) && !empty($matches['assign'])) ? $matches['assign'] : ''; $variable = 'hascontent_' . StringUtil::getRandomID(); diff --git a/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php index f3216ccb9b..bf65843af3 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php @@ -59,7 +59,7 @@ class JsFunctionTemplatePlugin implements IFunctionTemplatePlugin { } else if (!empty($tagArgs['lib'])) { if ($isJqueryUi) { - $src .= (ENABLE_DEBUG_MODE) ? '3rdParty/' . $tagArgs['lib'] : 'WCF.Combined'; + $src .= ENABLE_DEBUG_MODE ? '3rdParty/' . $tagArgs['lib'] : 'WCF.Combined'; } else { $src .= '3rdParty/' . $tagArgs['lib']; diff --git a/wcfsetup/install/files/lib/system/template/plugin/PageBlockTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/PageBlockTemplatePlugin.class.php index fa1a21930d..e5e515dec6 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PageBlockTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PageBlockTemplatePlugin.class.php @@ -51,7 +51,7 @@ class PageBlockTemplatePlugin implements IBlockTemplatePlugin { } else if (!empty($blockContent)) { $page = Page::getPageByIdentifier($blockContent); - $pageID = ($page) ? $page->pageID : 0; + $pageID = $page ? $page->pageID : 0; } if ($pageID === null) { diff --git a/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php b/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php index bd56feb7d2..ffe08c3368 100644 --- a/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php +++ b/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php @@ -103,7 +103,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy { 'fileType' => $uploadFile->getMimeType(), 'fileHash' => sha1_file($uploadFile->getLocation()), 'uploadTime' => TIME_NOW, - 'userID' => (WCF::getUser()->userID ?: null) + 'userID' => WCF::getUser()->userID ?: null ], $this->data); // get image data diff --git a/wcfsetup/install/files/lib/system/upload/UploadHandler.class.php b/wcfsetup/install/files/lib/system/upload/UploadHandler.class.php index 1b94456a90..f736d0b672 100644 --- a/wcfsetup/install/files/lib/system/upload/UploadHandler.class.php +++ b/wcfsetup/install/files/lib/system/upload/UploadHandler.class.php @@ -52,11 +52,11 @@ class UploadHandler { // multiple uploads for ($i = 0, $l = count($rawFileData['name']); $i < $l; $i++) { - $this->files[] = new UploadFile($rawFileData['name'][$i], $rawFileData['tmp_name'][$i], $rawFileData['size'][$i], $rawFileData['error'][$i], ($rawFileData['tmp_name'][$i] ? (self::getMimeType($rawFileData['tmp_name'][$i], $rawFileData['type'][$i])) : '')); + $this->files[] = new UploadFile($rawFileData['name'][$i], $rawFileData['tmp_name'][$i], $rawFileData['size'][$i], $rawFileData['error'][$i], ($rawFileData['tmp_name'][$i] ? self::getMimeType($rawFileData['tmp_name'][$i], $rawFileData['type'][$i]) : '')); } } else { - $this->files[] = new UploadFile($rawFileData['name'], $rawFileData['tmp_name'], $rawFileData['size'], $rawFileData['error'], ($rawFileData['tmp_name'] ? (self::getMimeType($rawFileData['tmp_name'], $rawFileData['type'])) : '')); + $this->files[] = new UploadFile($rawFileData['name'], $rawFileData['tmp_name'], $rawFileData['size'], $rawFileData['error'], ($rawFileData['tmp_name'] ? self::getMimeType($rawFileData['tmp_name'], $rawFileData['type']) : '')); } } diff --git a/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php b/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php index 3858351477..649cb9c60b 100644 --- a/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php +++ b/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php @@ -68,7 +68,7 @@ class GroupedUserList implements \Countable, \Iterator { * @return string */ public function getNoUsersMessage() { - return ($this->noUsersMessage) ? WCF::getLanguage()->get($this->noUsersMessage) : ''; + return $this->noUsersMessage ? WCF::getLanguage()->get($this->noUsersMessage) : ''; } /** diff --git a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php index 1645bcedc2..a79bedc31d 100644 --- a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php @@ -171,7 +171,7 @@ class UserActivityPointHandler extends SingletonFactory { $statement = WCF::getDB()->prepareStatement($sql); foreach ($userToItems as $userID => $items) { $statement->execute([ - ($items * $objectTypeObj->points), + $items * $objectTypeObj->points, $items, $objectTypeObj->objectTypeID, $userID diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 23a3f5559b..b448ada125 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -197,15 +197,15 @@ class UserNotificationHandler extends SingletonFactory { $recipients = $recipientList->getObjects(); if (!empty($recipients)) { $data = [ - 'authorID' => ($event->getAuthorID() ?: null), + 'authorID' => $event->getAuthorID() ?: null, 'data' => [ 'eventID' => $event->eventID, - 'authorID' => ($event->getAuthorID() ?: null), + 'authorID' => $event->getAuthorID() ?: null, 'objectID' => $notificationObject->getObjectID(), 'baseObjectID' => $baseObjectID, 'eventHash' => $event->getEventHash(), 'packageID' => $objectTypeObject->packageID, - 'mailNotified' => ($event->supportsEmailNotification() ? 0 : 1), + 'mailNotified' => $event->supportsEmailNotification() ? 0 : 1, 'time' => TIME_NOW, 'additionalData' => serialize($additionalData) ], diff --git a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php index 690a4b1e8d..1cf7b375a3 100644 --- a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php @@ -103,10 +103,10 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker { $data = []; // update cumulative likes - $data['cumulativeLikes'] = (isset($cumulativeLikes[$article->articleID])) ? $cumulativeLikes[$article->articleID] : 0; + $data['cumulativeLikes'] = isset($cumulativeLikes[$article->articleID]) ? $cumulativeLikes[$article->articleID] : 0; // update comment counter - $data['comments'] = (isset($comments[$article->articleID])) ? $comments[$article->articleID] : 0; + $data['comments'] = isset($comments[$article->articleID]) ? $comments[$article->articleID] : 0; // update data $editor->update($data); diff --git a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php index b5d408003c..7a7286a160 100644 --- a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php @@ -109,7 +109,7 @@ class MailWorker extends AbstractWorker { ON (user_option.userID = user.userID) ".$this->conditions." ORDER BY user.userID"; - $statement = WCF::getDB()->prepareStatement($sql, $this->limit, ($this->limit * $this->loopCount)); + $statement = WCF::getDB()->prepareStatement($sql, $this->limit, $this->limit * $this->loopCount); $statement->execute($this->conditions->getParameters()); while ($row = $statement->fetchArray()) { $user = new User(null, $row); diff --git a/wcfsetup/install/files/lib/util/DOMUtil.class.php b/wcfsetup/install/files/lib/util/DOMUtil.class.php index 4c78923912..57af1a1895 100644 --- a/wcfsetup/install/files/lib/util/DOMUtil.class.php +++ b/wcfsetup/install/files/lib/util/DOMUtil.class.php @@ -128,7 +128,7 @@ final class DOMUtil { * @return \DOMNode parent node, can be `\DOMElement` or `\DOMDocument` */ public static function getParentNode(\DOMNode $node) { - return ($node->parentNode) ?: $node->ownerDocument; + return $node->parentNode ?: $node->ownerDocument; } /** @@ -146,7 +146,7 @@ final class DOMUtil { $parents[] = $parent; } - return ($reverseOrder) ? array_reverse($parents) : $parents; + return $reverseOrder ? array_reverse($parents) : $parents; } /** diff --git a/wcfsetup/install/files/lib/util/Diff.class.php b/wcfsetup/install/files/lib/util/Diff.class.php index 6c69fd437f..e5ae6aa48f 100644 --- a/wcfsetup/install/files/lib/util/Diff.class.php +++ b/wcfsetup/install/files/lib/util/Diff.class.php @@ -297,7 +297,7 @@ class Diff { } // calculate marker - $result[] = '@@ -'.($leftStart).(($j - $plus - $start) > 1 ? ','.($j - $plus - $start) : '').' +'.($rightStart).(($j - $minus - $start) > 1 ? ','.($j - $minus - $start) : '').' @@'; + $result[] = '@@ -'. $leftStart .(($j - $plus - $start) > 1 ? ','.($j - $plus - $start) : '').' +'. $rightStart .(($j - $minus - $start) > 1 ? ','.($j - $minus - $start) : '').' @@'; // append lines foreach (array_slice($d, $start, $j - $start) as $item) $result[] = implode('', $item); diff --git a/wcfsetup/install/files/lib/util/FileReader.class.php b/wcfsetup/install/files/lib/util/FileReader.class.php index a9f650e00c..de355f15d6 100644 --- a/wcfsetup/install/files/lib/util/FileReader.class.php +++ b/wcfsetup/install/files/lib/util/FileReader.class.php @@ -153,7 +153,7 @@ class FileReader { } // send file size - $this->addHeader('Content-Length', ($this->endByte + 1 - $this->startByte)); + $this->addHeader('Content-Length', $this->endByte + 1 - $this->startByte); // cache headers if ($this->options['maxAge']) {