Remove unnecessary parentheses
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 07:08:22 +0000 (09:08 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 07:08:22 +0000 (09:08 +0200)
185 files changed:
wcfsetup/install.php
wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php
wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php
wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php
wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/LoginForm.class.php
wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php
wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php
wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php
wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php
wcfsetup/install/files/lib/acp/form/PageEditForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php
wcfsetup/install/files/lib/acp/form/RescueModeForm.class.php
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/acp/form/TagEditForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php
wcfsetup/install/files/lib/acp/page/IndexPage.class.php
wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php
wcfsetup/install/files/lib/acp/page/TemplateDiffPage.class.php
wcfsetup/install/files/lib/action/MessageQuoteAction.class.php
wcfsetup/install/files/lib/action/PollAction.class.php
wcfsetup/install/files/lib/core.functions.php
wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php
wcfsetup/install/files/lib/data/article/Article.class.php
wcfsetup/install/files/lib/data/article/ArticleAction.class.php
wcfsetup/install/files/lib/data/article/ViewableArticle.class.php
wcfsetup/install/files/lib/data/attachment/Attachment.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php
wcfsetup/install/files/lib/data/box/Box.class.php
wcfsetup/install/files/lib/data/box/BoxAction.class.php
wcfsetup/install/files/lib/data/box/BoxList.class.php
wcfsetup/install/files/lib/data/category/CategoryEditor.class.php
wcfsetup/install/files/lib/data/comment/CommentAction.class.php
wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php
wcfsetup/install/files/lib/data/language/LanguageAction.class.php
wcfsetup/install/files/lib/data/language/LanguageEditor.class.php
wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php
wcfsetup/install/files/lib/data/menu/MenuAction.class.php
wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php
wcfsetup/install/files/lib/data/package/PackageAction.class.php
wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php
wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php
wcfsetup/install/files/lib/data/page/Page.class.php
wcfsetup/install/files/lib/data/page/PageAction.class.php
wcfsetup/install/files/lib/data/session/Session.class.php
wcfsetup/install/files/lib/data/style/Style.class.php
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php
wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php
wcfsetup/install/files/lib/form/AbstractModerationForm.class.php
wcfsetup/install/files/lib/form/MessageForm.class.php
wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php
wcfsetup/install/files/lib/form/SearchForm.class.php
wcfsetup/install/files/lib/page/AbstractArticlePage.class.php
wcfsetup/install/files/lib/page/ArticlePage.class.php
wcfsetup/install/files/lib/page/AttachmentPage.class.php
wcfsetup/install/files/lib/page/CmsPage.class.php
wcfsetup/install/files/lib/page/MediaPage.class.php
wcfsetup/install/files/lib/page/SearchResultPage.class.php
wcfsetup/install/files/lib/page/UserPage.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php
wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php
wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php
wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php
wcfsetup/install/files/lib/system/box/BoxHandler.class.php
wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php
wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php
wcfsetup/install/files/lib/system/comment/CommentHandler.class.php
wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php
wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php
wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php
wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php
wcfsetup/install/files/lib/system/database/util/SQLParser.class.php
wcfsetup/install/files/lib/system/email/Email.class.php
wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php
wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php
wcfsetup/install/files/lib/system/html/metacode/converter/QuoteMetacodeConverter.class.php
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php
wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php
wcfsetup/install/files/lib/system/io/GZipFile.class.php
wcfsetup/install/files/lib/system/io/Tar.class.php
wcfsetup/install/files/lib/system/io/TarWriter.class.php
wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php
wcfsetup/install/files/lib/system/language/I18nHandler.class.php
wcfsetup/install/files/lib/system/like/LikeHandler.class.php
wcfsetup/install/files/lib/system/mail/Mail.class.php
wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php
wcfsetup/install/files/lib/system/menu/TreeMenu.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php
wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php
wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php
wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php
wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php
wcfsetup/install/files/lib/system/option/MessageOptionType.class.php
wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/OptionHandler.class.php
wcfsetup/install/files/lib/system/option/SelectOptionType.class.php
wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php
wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php
wcfsetup/install/files/lib/system/poll/PollManager.class.php
wcfsetup/install/files/lib/system/request/ControllerMap.class.php
wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php
wcfsetup/install/files/lib/system/request/Route.class.php
wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/JsFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/PageBlockTemplatePlugin.class.php
wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php
wcfsetup/install/files/lib/system/upload/UploadHandler.class.php
wcfsetup/install/files/lib/system/user/GroupedUserList.class.php
wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php
wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/MailWorker.class.php
wcfsetup/install/files/lib/util/DOMUtil.class.php
wcfsetup/install/files/lib/util/Diff.class.php
wcfsetup/install/files/lib/util/FileReader.class.php

index 4deab788070e69fbe3f6e8348d3511939c0f2b44..636b7a333f076146742c17e2b0b53d75fe7d0ffb 100644 (file)
@@ -398,7 +398,7 @@ class SystemException extends \Exception implements IPrintableException {
                        </div>
                        <?php
                        $first = false;
-               } while (($e = $this->getPrevious()));
+               } while ($e = $this->getPrevious());
                ?>
        </div>
 </body>
@@ -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;
index 1c0c488a9578f17f03deac63f90fdb3c4870be10..f7e0294c582a9234f9392a83fdd41739875ba2ec 100644 (file)
@@ -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
index b58082695b3be5148536c9c64e563f8880217277..f2f162c4e569cbd0c67c5899cab726ce9bc963fa 100644 (file)
@@ -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,
index 01dead1c667a36f6ee157e0224c49ed1d31be9a6..22d053ade029af07916faf8b30d6adf72da9ca25 100644 (file)
@@ -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()]
                                        );
                                }
                        }
index 64e480ce8bdd436d2885644116056a3a7ede40a3..33d74bb59d0c40689530df591f9554d506630767 100644 (file)
@@ -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();
index df848a24b6928cf5674130468e9dd7d410e5ae0b..6747446c584dc8df8bdce9698b5668268b8d7fe4 100644 (file)
@@ -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)
                ]);
        }
 }
index 9b1753288390f96f96d0d7303aae990d4e6ca059..21e84a6e528b4c062de669fad15be0dd96a1eeb5 100644 (file)
@@ -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' => ''
                ];
index 72baa42fd79a971a8ddb2e755ce46a5591a4ff75..8e6dcc7e655256a9836a2fc92a9474e3e58675b7 100644 (file)
@@ -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) {
index fe12d22428b07f6c04697abc3bd933f97090b4bd..4a3891dd8f5054e056900caa6b68e65a5c563ac1 100644 (file)
@@ -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
                ])]);
index 8bc5a70ae7830199ec749a3a38334170c8a0f574..40257c6e3812ceb0fb522423597f416f12abc730 100644 (file)
@@ -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();
index 8a6b1a28266edc9558ffa85b98062a7be8421b1c..237ff3606883a772e64795017e3f4fa108aa250c 100644 (file)
@@ -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);
                                        }
                                }
index cee385976556ad30781b2faeb406a1e38a7a7a54..69aa01e9c21cc65f50c790f1e9ce6025de534378 100644 (file)
@@ -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;
                        }
                }
                
index e96729a5d9c7142caf972c05b033aecd4c83bf22..f60a269f39d8086b23e2911db77ef98b751022a9 100755 (executable)
@@ -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(),
index 5b7c7583aeef255f622eea79fe17c59a16f09be1..772ce2ce4fd045934284373cf02938f87d50ec0c 100644 (file)
@@ -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
index 994330afb9b5fd7980ac90c23fc73f70c172e54b..7d9effbc34f8e7612dc78be048c20c8ba93ea715 100644 (file)
@@ -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]);
index c110cd215a5e96d59ead8fd49b05934234b9af64..7b60b8fa1dbb3faabbbcd8180dd4e97d7880ab69 100644 (file)
@@ -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,
index 17f62fe92309ea236d0894a85a2eca9b9b30ed93..41803de3ecbcd9acaf23534f85464e196dc1f05d 100644 (file)
@@ -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
index 007aa15bcbbe29d4a392044a54da18e2e8c2bc72..d6149d2443ae9638a4301cd2b30c044655354085 100755 (executable)
@@ -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();
index 627dfb8b52f92b6197bb8987ad8b5f9e570e952f..7f4ee640efdb3a2c9149569e9569a28fd1f18ba1 100644 (file)
@@ -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,
index 21ecc66dc03fc842c582fd091984e49f38742d52..17deca08b3c7a7f99c419bbf991061e145513175 100644 (file)
@@ -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] : ''
                                ];
                        }
                        
index adcf0bac4467435471c5e0efd638132a8d82c649..1d6e3e3653d90f57c0142985042cf67c5c3c87e1 100644 (file)
@@ -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([
index f22c6675977b5f3298793c7007c5bbae66615221..89c1ffe5ce3417a6dea43e43697623151b7b252a 100644 (file)
@@ -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(),
index 66e7dbeb8a057f3cd95c31b39b9b40d53fa18aa9..c064a0677edcea6a46e03a1dd8e6ba50d75c6b96 100644 (file)
@@ -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']);
index 2b4410d1cd5a2606aa40a7c8364970ed2ca8450c..4dfc8dd1d03ce36e889588b71872261f0509b4f2 100644 (file)
@@ -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
                ]);
        }
 }
index 55d9c66bc755f8401cf8341857de505415e945f3..6eccbe2ce55d1d0372a9bd5ac8de68995ea93988 100644 (file)
@@ -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();
index ca02bbe1566c0be3654aa90610b7f85808052322..1bbfb1f4a36adca1a1ee5572d6f40dab942b5464 100644 (file)
@@ -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();
index 64d30ab06aeb8d6acb5869f6fe3caa6b4b643828..ae612bd85d4cd9a316ae3f97b3f0b2b9dc390256 100644 (file)
@@ -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);
                }
        }
index 14ea99e02cdddbd6311fb41cf66a68113f11ba79..b1183151c975f07d3c30b8b263de5a4419aa3664 100644 (file)
@@ -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();
                
index fac4f2f497b6d9fec3e902e0bc52f9c102f9a868..379c29197e796904e8cfc332b9b37b15232c1b46 100644 (file)
@@ -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,
index bd30b08e1c35c2e495984eac2314ba6c620ed397..874ca43c01619272817fe74efd318683ea9c87ae 100644 (file)
@@ -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,
index 4d534b45b9b886e9918775ace19bbe4f5ae8c384..a840a8427d2e90c4a4cc7dac4a15c43542fe3aa5 100755 (executable)
@@ -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' => ''
                ];
index 8a326238ead690c22830c2a06cb239e89a1ebde5..d1381946b49311547f074d2f840345536f490e91 100644 (file)
@@ -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']);
index 45e70e45e562c65c159c17ce252a7a797cf62143..03e296cfa7b64d3bbdef28764eeda41d6249b062 100644 (file)
@@ -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
index 257d27fdfe3a10b80e3ef4a431b3acb66ed214a9..f3c383853bebdcea80eb4f21b36569cbcdf9a0db 100644 (file)
@@ -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);
        }
index f85a9b136b563c68782928e33ecaa0e1b67a631a..7a3917dfd677c8c4db0d4185dd4021569a02d6c0 100644 (file)
@@ -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;
        }
 }
index f3b10618c73773cab1ce1ced6afed784fc627173..04959d78b304be571639e1103b239b5b5dc86cad 100644 (file)
@@ -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;
                                        </div>
                                        <?php
                                        $first = false;
-                                       } while (($e = $e->getPrevious()));
+                                       } while ($e = $e->getPrevious());
                                        ?>
                                <?php } ?>
                        </div>
index 2ecaaf3e4691ccca263a6cd8791f2bf30c18ac15..f7d8680c74c4969b4d1275f0c1b9d51843d93f31 100644 (file)
@@ -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;
index 8e41d87d322c6e5f867cb749079cfad12f35126d..b31b613c738f73eafdcadc4d8102ba461017bbf7 100644 (file)
@@ -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);
                        }
                }
                
index cd57ca28fbd8796611ddab1112074271c1755169..473537a05837ef46e4944ef0a6f12ab4bd8e459c 100644 (file)
@@ -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]);
                                                }
                                        }
                                }
index 6ab05921d8dcd430470d85c9864d2192da3b3b9d..f5c06c638f61a0e6df914316328540ab8c0bf673 100644 (file)
@@ -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;
        }
        
        /**
index 8b6cec1420c814283cb558769568f5e697688ab1..09a7787b9f2a940200ae53ac0f11180744d06960 100644 (file)
@@ -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;
        }
        
        /**
index d16bc024c37c79f51b025d852520ded7e270453d..8e8b2c8ff0cf357d6ed7a2defa83b4d3cc68c95a 100644 (file)
@@ -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
index 191cd1aa8304798f09f3377cc2be8cb7bea222df..9b39b683ea99b815da64f1f19aa18d8df461cdbe 100644 (file)
@@ -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();
index 21864d9fdd919735f92fd3a17dfd5e0a1dc7f2ff..08d8967c1159d4c96110ec63ca70067b6fd58083 100644 (file)
@@ -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);
                        }
                }
                
index 88f3ba46c2ef012b6fe5a4039316230fc8b86497..7a3df6321d0ce4a7ff15d0dc759934dee5199e6d 100644 (file)
@@ -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]);
                                }
                        }
                }
index 61dba7100fff034997d8be093ebc51ad927b1a6c..fb5f5fe150693f467942a0395f1cc1f3e46ca935 100644 (file)
@@ -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]);
                                }
                        }
                }
index e8b555ee89d384c1d6e7a1fd3953e9c8fd625896..0d345c26db92f6c3d84aacffe367360f4c030c98 100644 (file)
@@ -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']);
index 41ea0b5284f2045bd657beef85880141810a6c06..f39953553fb989d6998ce4d19c003b4e2c70cfb4 100644 (file)
@@ -182,7 +182,7 @@ class CommentAction extends AbstractDatabaseObjectAction {
                
                WCF::getTPL()->assign([
                        'commentList' => $commentList,
-                       'likeData' => (MODULE_LIKE ? $commentList->getLikeData() : [])
+                       'likeData' => MODULE_LIKE ? $commentList->getLikeData() : []
                ]);
                
                return [
index 0a2094928f628f08b54c64310ed48dde16618afb..3dca31241ab084775b657cd02304847da576387d 100644 (file)
@@ -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
                ]);
index cb8232891462cc2787f79d6d2db4a1d9d4d6ea73..1d9cd6b440ddde1b59fc22ab907733ae3405bc2e 100644 (file)
@@ -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
index 45cade5b180d68e3fbf2a065ec628afcfc0f3618..f5d6eb0f2da2be3c50b501054bdbee43527e5343 100644 (file)
@@ -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]);
                }
        }
index 88b237f6e39edb327403a0467353507a66fd4e93..ad8d0d601ff5c03ce7c7df4c759e1752e42a0127 100644 (file)
@@ -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
index 44b44e5152a473265a8a95ec79b6975067a1044e..3378a34409eacb845843aa4870751fdf5461a8fa 100644 (file)
@@ -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 {
index 1a8282e4eaaac67dc1e6eeea026fee4b173da275..77f05fdddf781129d0de5d18a00117310b380f6a 100644 (file)
@@ -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
index 559feb654ef54b46a0abcc207d4069ba550ecf0e..2474e51b6e804bae808139770b5fcee7cead30da 100644 (file)
@@ -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
                                ]);
index 555fd50b7a44bf4d411b5a531bf9760c788529c3..3fbdc9b9d812128ac5093c117a523613ad9ec841 100644 (file)
@@ -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]);
index b7955a49e9ac1cfbf4972da09772d6a581c2fd90..025a841309a562e9e92e13b3f9573b599c19911c 100644 (file)
@@ -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,
index 2bf292f9f163579563c798997d9c4139f3d1661c..f4bf63aa9bda87381b2603ebb2662699b56ea578 100644 (file)
@@ -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'])) {
index 69940665158c50f24f0505a7f60a263d487ea2d1..e2e8bb0291fa81f3a44be0e96b271702382af6da 100644 (file)
@@ -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']
                                ]);
index 7f9394a0e59f65460a2f673ac03104a0c1c30edd..4ab68304b48510a6f4ba64102fce88b1986a822e 100644 (file)
@@ -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]);
                }
        }
 }
index c53c3b5bacab0cd284bc1dec6a8649020edb466d..4b36a34aa1f3bf22ff712a8bc0b7265f3af7c885 100644 (file)
@@ -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);
                        }
                }
                
index 9e65fa65cfc22ec82cf1542efb23e5247c08ef66..185bc544b321acb9e56a6050df4307e4e4e1c468 100644 (file)
@@ -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]);
                }
        }
        
index 58604117b382c1592c777e255c6f3c2da8085d2b..06bb9e94e9c89922f44ea7dce81bcb8918be2b3e 100644 (file)
@@ -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;
        }
 }
index dafa30e04a42188c1d44f708f0413497ff746e6e..39462a197adc003a9fef4afa9dd4d61ebc910753 100644 (file)
@@ -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] : ''
                ];
        }
        
index c14b02bcd471e4026608e8aed189d03243fe8ed0..bdadac970e14643136af52e7fd406db2b7133c6a 100644 (file)
@@ -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();
                        }
index ea046225c3c1bad856d60a5b7dbaf62534f06602..5d321cc5ce09514e98964d9b1022ca69258427e8 100644 (file)
@@ -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', [
index 9a8a8197b58b1de019b8cdbdbc3fe14be8609da0..7a9d81f32d447766d1e1ac3adf0434dd5748ea94 100644 (file)
@@ -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 [
index 76510d5c92a96aec84004270fff68e3ea4343a70..501d46f5b76480463266e4edde3c697444a27c1d 100644 (file)
@@ -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();
index fd6811949eb3c7bafa7b518b499e152e76cabd65..86d166e0bfffda3012d4c07a483abef220d111b5 100644 (file)
@@ -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;
        }
        
        /**
index 57dd14d6a3b8fb4627eb98254ca8e72babd9d174..bec706d6c497112241ed5fa2421d876113908132 100644 (file)
@@ -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
index 95f7ded2a7277d4b34f7993436ffdf9395ba4e4b..f467f0043bfebb9f0b926544791f916529d5db5f 100644 (file)
@@ -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
                ]);
        }
        
index 4e7082229b1e9252a8f84d3b890dc62535b29a3e..d9c487e50f83b82e90cb5dd7c48da0204de29ca5 100644 (file)
@@ -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,
index a5100d651e3ffb7a84584cc80466f6ef772f16a2..29db8278a7241f6f3e680caed4d23038e34bf4df 100644 (file)
@@ -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;
        }
        
index 2ea2b16706d81d44963aec02e4edffeb0968efe1..8fcb1f7462676867c1fe92e8e49df964351250ab 100644 (file)
@@ -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',
index dcf22741845aebb7de61f5e64907efa46938807c..1bbbf760e9f1e8af060aeb8c3a76e478a6ffafc2 100644 (file)
@@ -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());
index 4201e15a96022845500cbf1be5fbc9162997d32a..c554ea9fc7d20fd0b0ac9b2d3fbec95ce011375c 100644 (file)
@@ -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
                ]);
index 104323de7518ad2b4b2b453b519f0aaaecd62122..4facaa6ef7ace868ac7cd35c098c5c31476af7da 100644 (file)
@@ -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
index 2645e74a5b1fd593438df4e18e5b681de8c38e67..743ad7b0ec4df821a135804b33c3af9a36aac584 100644 (file)
@@ -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
                ]);
        }
index 6f83181e48386acc4971add4c1fec0191ee45393..2b3b43ab69735a31eefcbe4612ac18c8e3c26811 100644 (file)
@@ -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
index 2473e0ecbfdaa5512341426d84a8a917b4aa3acf..0a5c85fc0ec0baaebe3dbf8cff76e067d147a589 100644 (file)
@@ -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,
index ec048f5c2cf332ecdced37247af6a43cc9c8b313..d62f670b5e2e8b60da38a4ab375dc8e73cd7d660 100644 (file)
@@ -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())
                ]);
index abcc054b92e1a605c9009ad2ae7f8a36ef4e9cec..badbd5f0cd2b6ec5644a8d3e80ab07a6718c851a 100644 (file)
@@ -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);
                }
        }
 }
index 821aa7c527021cbf1a6e8cfb17b14de80f5c3946..e030a9dbf3a8c50ed128810d336b99f60516052b 100644 (file)
@@ -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
index 0bc513e92ea37480c5b257504ea99b21cb8b15e4..eaf3eaaad840dd8af1118c18780e93d244aae5f6 100644 (file)
@@ -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);
index f9a582daeaceed8c8e6e8eeddafad50d676d9ce2..2b358a0de80c54fb88b10df3036003c2f1c252ad 100644 (file)
@@ -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);
index 1907f041bbba4a7def5606287fab154adeef47e8..fd04f4bed9bd82886180b789907c01b556f0383a 100644 (file)
@@ -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";
                }
        }
 }
index 363c057c298504e71020785abd39b4bdcb638a69..00b5b2890a1f90a86959f3f41a27df406599d34c 100644 (file)
@@ -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');
                }
index 70f0d6696f90e9fe744a97a29785f8a9d076fc4a..abd883b299ec70d6002e1116e0a57c5cac8d9f5a 100644 (file)
@@ -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
index 50a82df96122b19b7509b7854531778ff17b8c2f..6957fdf713603ade5ecf84449ff687b76af16037 100644 (file)
@@ -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;
        }
        
index d6f99dc308829d58d3b5dddbfac0f542a8c0e9f9..d35fab4d2aa58220ba141d9457a7d31b2c592228 100644 (file)
@@ -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]);
                        }
                }
        }
index a728be8e46a24b09737ce73ffd3324d18348569b..68d180a7235c9e91cc19275951919bb41a3b0e1e 100644 (file)
@@ -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() : []
                ]);
        }
        
index 0190ec0d9ade49183be35014298b9e0708c587c2..b13416be82401cdb91d8ea1ff16925eb6285299b 100644 (file)
@@ -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;
                                                }
                                        }
index 9476373b16e27a94faf24453303f91236c7dbb8e..403cf35430645c230a5a73492ea0454e98a39940 100644 (file)
@@ -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']
                        ]);
index bc7eca202efc66a53a99f77eca45edfd32e3c211..5bd08ff739afe306c8427fc163f8ee063e98f7ad 100644 (file)
@@ -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()
index b0817373f6a43320990a98fe67fba23eecddc68b..272d84417aeb62f3cefd54477e6e72c404d0d059 100644 (file)
@@ -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']]));
index ac60f0204f65ff2cc53cce89edbda8593ef1ab8e..2f294b14d8840aafc79904e0b87fe2caf543ccba 100644 (file)
@@ -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);
        }
        
        /**
index fbd763d392b62644afc0e33d34372db0636b2609..51452adc11f7aa4a69e3e032bd4f4ee73d25c818 100644 (file)
@@ -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);
                
index 98af50a47c95b36a6733797d9c66610224ba9f83..dae33cf02030723c7ad1b786e486a3105aef4535 100644 (file)
@@ -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);
                }
                
index e37e0942e990fd04b3b24424470a6c294d508f9a..9448d686c8b98602dce9e18b3fc1ee26542c2ed4 100644 (file)
@@ -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
                        ]);
                }
                
index 6fb45d5335063d0d7f819dd6941d9a93135131d5..8727fb74a96287f2ec5896133077e1d78a45724b 100644 (file)
@@ -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);
                
index 040b5814f39aaa5632f7a63bf04513234c366501..f83593e7190c95733923835d7fe99c9dd5ce8a51 100644 (file)
@@ -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);
                
index 25336371a40a5b595d1814f4b755695a888ccacd..7ee0bf09bdacedec7b269c1413197864f99d6c1b 100644 (file)
@@ -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
                        ]];
                }
                
index 0bf554cfcd90dc5b6998edd22129589bf7263c83..e55945fbe1355cfef837c668258060c6a69cdb38 100644 (file)
@@ -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];
                        
index e9a605f1853fac955be7d03fc1596e5d98d823a6..875ea5470b7eb247269c4edbe02cfc47c1df0881 100644 (file)
@@ -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];
index 41122c8a133719c13f2dc769ac7d8e4522f06649..4b50aa39bca6deab8ea33840354fa23fca3352c2 100644 (file)
@@ -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) {
index f9ce4c1356c5715021fe81d1d0c865ee73493832..4ceb8d86b91c71974ddbfa15753dd63ecf2b9101 100644 (file)
@@ -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'])) {
index 18c193edfd635b6f8c3ff3733595c54a8ac4a92b..2b370d658373fff5be7f1ef7366ee469467e5ffb 100644 (file)
@@ -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()) ? '<small class="innerError">'.$this->getError().'</small>' : '';
+               return $this->getError() ? '<small class="innerError">'.$this->getError().'</small>' : '';
        }
 }
index c534df2415e102cfd9d22972303fb700cc042f3c..2980b210e669ac51192604565f9bcdd4d7e355bf 100644 (file)
@@ -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'];
        }
        
        /**
index e3e46b7ee59f2a19a8d613e338aababa568811a5..7542af6d1d98215de297abcc56ac497e92545bee 100644 (file)
@@ -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
index 0028740a49570f179a5a9484369dc22c125ae724..7bbe7087782ac4ab04e01dce17d47026be63f99f 100644 (file)
@@ -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);
        }
index 0766b7b904942f15606ef665a1ff12531f10d6b4..010536d7089ea328459cede93c64a26ce17ee4a2 100644 (file)
@@ -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;
index 3cca2303284c18c478c9220c387eea87f61d54c5..a9e7268ea1ce80856fffee97cff2accd49a82b04 100644 (file)
@@ -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);
index d793d290b7ca6ed1790757599a25831490652770..1cefdc211a5bc507a4a64f966612586ba7b38bab 100644 (file)
@@ -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));
        }
        
        /**
index 22d8745decf311c73eea78feed269539db86b1af..e62d1a854c4bf0fc17ac971ed6c378553976cfe7 100644 (file)
@@ -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;
index e560bcdc8f738d6f2caa1881484af7cf12bcd36e..2c27f1b9737a03659f7f1c94983269733aa500c3 100644 (file)
@@ -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)));
                }
        }
        
index 2f1fb159835ba5ada1289f3595a55b2a73940b96..5a65b1364aadd106aa506a5450f4e6635bad2ef1 100644 (file)
@@ -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));
                }
                
index 8ff08fcdacfc2c84bec3cf196dc1fdadaa85e986..c428911fc545711c2670af9360810b6c426326ab 100644 (file)
@@ -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)
index e9a90dccaf119ec86c98ed185e69dbef1b618826..8e134400bb21fce046fe78af84c0373c9ed4000f 100644 (file)
@@ -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]
                                ]);
index a2e916707bc2e426f04e77f955ea10c99e539b3c..ed7a2cb0021636915a74d2632e57e940ca8133a9 100644 (file)
@@ -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
index 6a2f2b04cbd58958dbad6ea2b6417c21b4cd3d6e..d1f65e06fce336d3f5daf99d536803e4a6465a4e 100644 (file)
@@ -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)];
        }
        
        /**
index c529f91fc72715707ee5ecb6a34e682376e61f77..1c0458762533f89ea960131a09d34866c0f7b72f 100644 (file)
@@ -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) {
index 0c7ad2332c2ea27021b73ec4c63c15444fde975e..62216db2b8fc397f60ce3d93e040f702a4a7744e 100644 (file)
@@ -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;
        }
index 14cdda8909c647a7d230914896fea62a880e94cc..0093a7e058bdee48ed4f8bcd45cc6d371838b038 100644 (file)
@@ -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');
index 96e1ea3ad0e066fbccd08ec471c6ef7da8be351d..e192eba93c84d80910f01f3bdfb0197520cd4bf2 100644 (file)
@@ -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();
                        }
                        
index a5ec9618e364282175a6cc39d68a0e9beaae0a6d..7dfc6b36004a9b1c70eb6db8a8a49d8f70c4d686 100644 (file)
@@ -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])));
                        }
                }
                
index 68c2b86c50b164a63a99a73fe6829a1d63a7f8c9..e4cdb4d944002b0d23bb5915eb1ef350517ce49b 100644 (file)
@@ -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
index 57d88e6e0b4d69c41f28b32b14859cdb09bb0d9a..53fbdb2fbbe7d33d638ea00104a4284c222c1925 100644 (file)
@@ -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)
                                ]
index de8714f2b43c426875b6a511372bafc79236398b..805697a66c075c8c34bf21c572933020fe3973aa 100644 (file)
@@ -326,7 +326,7 @@ class ModerationQueueManager extends SingletonFactory {
                        $statement->execute([
                                $queueID,
                                WCF::getUser()->userID,
-                               ($isAffected ? 1 : 0)
+                               $isAffected ? 1 : 0
                        ]);
                }
                WCF::getDB()->commitTransaction();
index 461b8eae56b33b681a0281a7d80a1b17a546afea..b0a54aee6ca4c69f4d949b24b56c8f1b9082649e 100644 (file)
@@ -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)
                                ]
index 7cd100641425339601cae6f04cc44b60a7f6d824..745e9e5ece5bbd13fa720b0688dc0f6125a74a0d 100644 (file)
@@ -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');
        }
index 21dde661dea5db93825f378c97f3830c55c8b9c7..0dd6d67cd2fcaae508e38777d5d85b59cc7e62c4 100644 (file)
@@ -90,6 +90,6 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt
                        return 0;
                }
                
-               return ($value1) ? 1 : -1;
+               return $value1 ? 1 : -1;
        }
 }
index cf2ab8e66e34773bd54c2d66131f2f8ce9f841ad..eece0748b556e72bb9a05239b65e0ee3c317f1ec 100644 (file)
@@ -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([
index f87a9a86dd933377df889ada856503788a771d90..52c69486060f5c6ecb08f604e40dda2cb4d5e654 100644 (file)
@@ -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);
        }
index cd0631b773a8e6e52d85b8e5bbbdb9dda20e43be..c2c08195a6625c2a182151155d7a48523c516a5a 100644 (file)
@@ -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()
index 8cbdacc9a975e677d17ef070d7eb9b4cbb42f0d7..65002916524d6c42d41e4aaf0603f3e82583cfb7 100644 (file)
@@ -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');
        }
index 435a7509ad73092025501f2ae451c863e9ae32b2..efd9f3c88516636c14a6e9d345d93b706ce0e770 100644 (file)
@@ -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');
        }
index 487c01872fc70260dfbdfd42f8eb54d4cd64bf33..89a66ab8b9eddce76a6352be04ab1985ccc24d6e 100644 (file)
@@ -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);
index 23f087dc767fdb7ea461d740369d3f163198a9da..62dfd3336a1f995709995f89bd5c0cbdfcce0ec3 100644 (file)
@@ -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)) {
index 8a677df00a3328ccea9802543297b870f6663395..d653a892f611932eb775e7c9ded0c4e12b59477b 100644 (file)
@@ -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;
index 7325c5e93abc77c9b0843073c5eb0ffec30c37ad..6c474d238f33ed27a10d731f4112b36059f2f778 100644 (file)
@@ -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');
index 4b2855c27b096e6439061489fc8198f054140e5c..d7c8997db8120b35aa66422556ce73a48d98834b 100644 (file)
@@ -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'] : ''
                                                        ];
                                                }
                                        }
index 6848850d58333c431558c70032cb1ebb14280f23..a8dceabed273f43804b870fa63b9c6a7f8354b5e 100644 (file)
@@ -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
                        ];
index 1c46e5d4695bf5974fe5cc7b998aa64a391433c3..4033bef8d6d254014d667ba27e1e7183131381ec 100644 (file)
@@ -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;
        }
index b174f9a4a20fb078ec380c5a439baa3330c09a9c..e82764ba38966c9cd1827f3833a1a5fc463d3579 100644 (file)
@@ -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 [
index 3e0534301241c274f3417cf30a5763a3062736ed..2acbd4d7a2b37ea13217d9053fc5b32b2f3db5ae 100644 (file)
@@ -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
                ];
        }
index f58f731fb2007d043f1b68f8ac10f1e9ad8e6ad7..c4cfc71186dc56f0d067e83b3f661435b0ca33b0 100644 (file)
@@ -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
index 5cb3a7eb87fb22817cb95d8a361042127cb20788..f88cbb9e55107ea502fe94f3b56eff75230d1777 100644 (file)
@@ -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
index a83098a9211b71abe45ffc71c0e7afcff57bcced..5e6eeef8b80e70e38d5f6493c91adf54e4e0f087 100644 (file)
@@ -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
                                        ]);
                                }
                        }
index 7bbd03f959d0a7654cc2132b275fd9e9c8942aa4..7cfd9dedcaf4c34c65782c039d74a27f9ae5d56f 100644 (file)
@@ -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]);
                        }
                }
        }
index e1b9281f51af5003fa245548acf2b0dc8454ba31..e9dd0b729706a3defdf92211128e4718a8ace6cb 100644 (file)
@@ -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 [
index c08658ac340761db194cdc6a7df592b228d868f8..8403d0ff8cc1f6c54468294af49362b436599e7d 100644 (file)
@@ -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'],
index 71b4fc78ef1950e089db15cc8ac269c4d490a2ad..4b9b9fd650e3b5bcd1fa97c40b6c7a0cfa67f3ce 100644 (file)
@@ -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'] : ''
                ];
        }
        
index 7eefb822f9d6129452251d98fd545d583b75a53d..59009aeb40ec0e703868c8021a9fd2fcdfc55224 100644 (file)
@@ -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();
index e86992624f62c2ab7a594e2c1f4d15dfc249cdd0..361b0b7fd453ab8d445a5cfaf64d513f0737366d 100644 (file)
@@ -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]);
                                }
                        }
                }
index a41df038f055c20b16ec2e0e9affe97050c7226a..0ed2e890a594f0227462fb652fa4746635fb9dd0 100644 (file)
@@ -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'] : ''
                ];
        }
        
index f6a89dae4fa2003eb6bbc1f144cddc8661a0770f..c5f91875a43e2b0e37f4803d6d46fb33d9bf1b15 100644 (file)
@@ -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)
                ];
        }
index a63a0c83857a2efbc58e0adc0a203da1a99fef19..e7f6d9ac0a32572823ff53102a7273d7198d9aa2 100644 (file)
@@ -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
                ];
        }
        
index 66b74e087dba9bbb709ba830fb070556a2ebba5b..ef0145e799d6d5886eaca1dcec3230350d0d94c8 100644 (file)
@@ -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
                ];
        }
index d8b72552f9460ec8836ec7696e86cc4353e5e417..0c2c288bd992017b630f2ca35c4caa4ce16e086e 100644 (file)
@@ -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
                ];
        }
index ea7b2ec6b8d31728b5fa359f97411b370a9c1482..dc0079d9ccb566ef3c558bc2abe5d0e88ef08a62 100644 (file)
@@ -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']
                ];
index d8c422b8397c68f2f1629f0af2587b469a38fcab..091399d2eaaa280d112d8e9fde36e05c16a35dd7 100644 (file)
@@ -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,
index 698e3bf6f9cca12cdd3989f7135dbfb7bdc695c3..a0fb33aa26b8550765e42a4dc3a6b2af77d28c14 100644 (file)
@@ -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
                ];
        }
index d1cd122d2f35c4c9facab9477c82ee800f308b19..8498ad795eea9ca6b9da270e52835a0865854e11 100644 (file)
@@ -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']
                ];
index 9b724768148f97b52353dd32bdefedcb2a5a9207..304a0d270e961a71717051f38570abf1c1e73262 100644 (file)
@@ -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()
index 05427581e5266b520010046118a1b92c6c94e3cc..f75491fe9a4078080f4923199422412dddbd1c9a 100644 (file)
@@ -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,
index 45daa138831acd838b936cbe3efe49a8123708bf..7643dc2511929ad21ec20faa574acf00b774a708 100644 (file)
@@ -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) {
index c083072f11dd897916d3c4e1ae0f86c0803e384a..3dbf6e096f29eaf5d0b83fa04e771ef96a159722 100644 (file)
@@ -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];
                        
index e4767c08009dd126b9e7e59467f468794215cf0c..178d8986e9ac2af9cc9b62f4bc6b526a0518d412 100644 (file)
@@ -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']);
index 440de7c6211e450b8defc663d9fcc242bd194a7c..345b300a5d48288b6b8cf1390002551d79e09438 100644 (file)
@@ -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];
index cd08e130c8f22fee89eb5d77f767e90ee0dcd01d..53b4e83b170fb4039f377d8c929bf65d6e823f9a 100644 (file)
@@ -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']);
index 8d2c6b251e26e9b9f512082cd5b86038939da14b..8ffb725cb8dc8b24ed58619d16a56384d3a77611 100644 (file)
@@ -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);
index baa38abe7cdbddce20ae51645b13d738bfbcff56..6d7d2426669ae1da1c9b8854a18818938ddaa36d 100644 (file)
@@ -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.'"';
                                }
                        }
                }
index 8b186729ae67029151ecad933e2507627890f44f..a9e52a86f58c4524270e5412b43f0fc3b7b13b7f 100644 (file)
@@ -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();
                
index f3216ccb9b2c170bc7b92bd7fc24ad243f566301..bf65843af3f71729ccfc6f8f9423c8ac59150979 100644 (file)
@@ -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'];
index fa1a21930de72303177a0353bcd9e27b4dcab461..e5e515dec69dbd139f90fe01f955480c33fa7f09 100644 (file)
@@ -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) {
index bd56feb7d21a19d0dd7d0f2d77b16e201bb39039..ffe08c33684d379909ded21b5aa654b37f15a02f 100644 (file)
@@ -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
index 1b94456a9030232b22b3b04446758e12091a661f..f736d0b67235a505713b8b9290cd12aa4ead128d 100644 (file)
@@ -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']) : ''));
                }
        }
        
index 385835147743e76c9941f0ee4c1b6a37279f596d..649cb9c60bdab69e9fc57ca881699a69ab6fc408 100644 (file)
@@ -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) : '';
        }
        
        /**
index 1645bcedc21a11082f6b5e84351866429fff6cbc..a79bedc31d19bcf514d0de29a1482705fad10b11 100644 (file)
@@ -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
index 23a3f5559bc719dc4675a6652ee24440ecc47b73..b448ada125272c0dffd9684d227b7fabd5f0efeb 100644 (file)
@@ -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)
                                ],
index 690a4b1e8d968dabcd5c464e9b27cace7a3e4dcf..1cf7b375a362ff4c80d9e69ff9041169f22a617e 100644 (file)
@@ -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);
index b5d408003ca55e89fe0a18953060c0be5b7015f3..7a7286a1607494cab30df73bd5baa2dc287e683e 100644 (file)
@@ -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);
index 4c789239121ee946c7b28a56f680f48bc1be0a9d..57af1a1895ec1a29b178c8e058836481694c2cfa 100644 (file)
@@ -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;
        }
        
        /**
index 6c69fd437fd93dd84875c1dc73aac8f0b65fd150..e5ae6aa48ff8c1de080756b218e390db7561d305 100644 (file)
@@ -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);
index a9f650e00c6771fffc7f77b812104c0919fd00b7..de355f15d6b7f87c17067c8cb2e3136c06758436 100644 (file)
@@ -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']) {