From 826453f8a952a084efa58184253ed885b5d32e80 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 28 Apr 2019 13:50:09 +0200 Subject: [PATCH] Fix code (style) issues --- .../lib/acp/form/FirstTimeSetupForm.class.php | 1 - .../blacklist/status/BlacklistStatus.class.php | 1 + .../lib/data/comment/CommentAction.class.php | 4 ++-- .../lib/data/media/ViewableMedia.class.php | 1 + .../update/PackageUpdateAction.class.php | 2 -- .../lib/system/bbcode/BBCodeHandler.class.php | 2 +- .../TXmlGuiPackageInstallationPlugin.class.php | 17 ++++------------- ...ractHtmlInputNodeProcessorListener.class.php | 1 - .../input/node/HtmlInputNodeProcessor.class.php | 3 --- .../files/lib/system/mail/Mail.class.php | 1 - .../files/lib/system/request/Request.class.php | 2 +- .../lib/system/search/ArticleSearch.class.php | 2 -- .../lib/system/tagging/TagEngine.class.php | 1 - 13 files changed, 10 insertions(+), 28 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/FirstTimeSetupForm.class.php b/wcfsetup/install/files/lib/acp/form/FirstTimeSetupForm.class.php index 80a66f92e2..c59ef11b7e 100644 --- a/wcfsetup/install/files/lib/acp/form/FirstTimeSetupForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/FirstTimeSetupForm.class.php @@ -2,7 +2,6 @@ namespace wcf\acp\form; use wcf\data\option\OptionAction; use wcf\system\option\OptionHandler; -use wcf\system\style\StyleHandler; use wcf\system\WCF; /** diff --git a/wcfsetup/install/files/lib/data/blacklist/status/BlacklistStatus.class.php b/wcfsetup/install/files/lib/data/blacklist/status/BlacklistStatus.class.php index e6db68023c..6ec02c96de 100644 --- a/wcfsetup/install/files/lib/data/blacklist/status/BlacklistStatus.class.php +++ b/wcfsetup/install/files/lib/data/blacklist/status/BlacklistStatus.class.php @@ -74,6 +74,7 @@ class BlacklistStatus extends DatabaseObject { * * @param BlacklistStatus[] $status * @return string|null + * @throws SystemException */ public static function getNextDelta(array $status) { // Fetch the index file to determine the oldest possible value that can be retrieved. diff --git a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php index b866e11c6f..2a2b1b3d47 100644 --- a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php @@ -824,7 +824,7 @@ class CommentAction extends AbstractDatabaseObjectAction implements IMessageInli public function validateEdit() { $this->validatePrepareEdit(); - $this->validateMessage($this->comment !== null); + $this->validateMessage(); } /** @@ -885,7 +885,7 @@ class CommentAction extends AbstractDatabaseObjectAction implements IMessageInli public function validateSave() { $this->validateBeginEdit(); - $this->validateMessage(true); + $this->validateMessage(); } /** diff --git a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php index 28b33512bd..39289a64b2 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php @@ -127,6 +127,7 @@ class ViewableMedia extends DatabaseObjectDecorator { $width = $size; $height = $size; $link = null; + $marginTop = 0; if ($this->tinyThumbnailType) { $link = $this->getThumbnailLink('tiny'); diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index 931322ef4a..9dabc1c083 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -6,11 +6,9 @@ use wcf\data\package\update\server\PackageUpdateServer; use wcf\data\package\update\version\PackageUpdateVersion; use wcf\data\package\Package; use wcf\data\search\Search; -use wcf\data\search\SearchEditor; use wcf\data\AbstractDatabaseObjectAction; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\NamedUserException; -use wcf\system\exception\PermissionDeniedException; use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; use wcf\system\package\PackageInstallationScheduler; diff --git a/wcfsetup/install/files/lib/system/bbcode/BBCodeHandler.class.php b/wcfsetup/install/files/lib/system/bbcode/BBCodeHandler.class.php index 559960554e..7cced24b74 100644 --- a/wcfsetup/install/files/lib/system/bbcode/BBCodeHandler.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/BBCodeHandler.class.php @@ -122,7 +122,7 @@ class BBCodeHandler extends SingletonFactory { /** * Returns metadata about the highlighters. * - * @return string[] + * @return string[][] */ public function getHighlighterMeta() { if ($this->highlighterMeta === null) { diff --git a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php index 682922b110..34cfe1d6ec 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php @@ -76,10 +76,7 @@ trait TXmlGuiPackageInstallationPlugin { $this->saveObject($newElement); - /** @var DevtoolsProject $project */ - $project = $this->installation->getProject(); - - $xml->write($this->getXmlFileLocation($project)); + $xml->write($this->getXmlFileLocation()); } /** @@ -208,16 +205,13 @@ trait TXmlGuiPackageInstallationPlugin { DOMUtil::removeNode($element); - /** @var DevtoolsProject $project */ - $project = $this->installation->getProject(); - $deleteFile = $this->sanitizeXmlFileAfterDeleteEntry($document); if ($deleteFile) { - unlink($this->getXmlFileLocation($project)); + unlink($this->getXmlFileLocation()); } else { - $xml->write($this->getXmlFileLocation($project)); + $xml->write($this->getXmlFileLocation()); } if (is_subclass_of($this->className, IEditableCachedObject::class)) { @@ -293,10 +287,7 @@ trait TXmlGuiPackageInstallationPlugin { $this->saveObject($newElement, $element); - /** @var DevtoolsProject $project */ - $project = $this->installation->getProject(); - - $xml->write($this->getXmlFileLocation($project)); + $xml->write($this->getXmlFileLocation()); return $this->getElementIdentifier($newElement); } diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php index fd63fe0c2e..0251ee8405 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php @@ -1,6 +1,5 @@ getDocument()->getElementsByTagName('a') as $link) { $href = $link->getAttribute('href'); diff --git a/wcfsetup/install/files/lib/system/mail/Mail.class.php b/wcfsetup/install/files/lib/system/mail/Mail.class.php index 2ee54cd14e..58684c1f4e 100644 --- a/wcfsetup/install/files/lib/system/mail/Mail.class.php +++ b/wcfsetup/install/files/lib/system/mail/Mail.class.php @@ -7,7 +7,6 @@ use wcf\system\email\mime\PlainTextMimePart; use wcf\system\email\Email; use wcf\system\email\Mailbox; use wcf\system\WCF; -use wcf\util\FileUtil; /** * This class represents an e-mail. diff --git a/wcfsetup/install/files/lib/system/request/Request.class.php b/wcfsetup/install/files/lib/system/request/Request.class.php index e2c6385826..89de7fe310 100644 --- a/wcfsetup/install/files/lib/system/request/Request.class.php +++ b/wcfsetup/install/files/lib/system/request/Request.class.php @@ -114,7 +114,7 @@ class Request { /** * Returns request meta data. * - * @return string[] + * @return array * @since 3.0 */ public function getMetaData() { diff --git a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php index 5f33e23b0f..b3f87de013 100644 --- a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php @@ -5,8 +5,6 @@ use wcf\data\article\category\ArticleCategoryNodeTree; use wcf\data\article\content\SearchResultArticleContent; use wcf\data\article\content\SearchResultArticleContentList; use wcf\data\article\Article; -use wcf\data\category\CategoryNode; -use wcf\data\category\CategoryNodeTree; use wcf\form\IForm; use wcf\form\SearchForm; use wcf\system\database\util\PreparedStatementConditionBuilder; diff --git a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php index 6a1c5b5f0f..db14f92976 100644 --- a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php +++ b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php @@ -6,7 +6,6 @@ use wcf\data\tag\TagAction; use wcf\data\tag\TagList; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\InvalidObjectTypeException; -use wcf\system\language\LanguageFactory; use wcf\system\SingletonFactory; use wcf\system\WCF; use wcf\util\ArrayUtil; -- 2.20.1