From 200d76dff3d6110ed6c395c2814e9de90028c6f6 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 2 Oct 2016 11:04:51 +0200 Subject: [PATCH] Add missing/Fix existing method documentation --- ...MessageQuickReplyGuestDialogAction.class.php | 5 +++++ .../lib/data/poll/option/PollOption.class.php | 2 +- .../files/lib/data/smiley/Smiley.class.php | 15 +++++++++++++++ .../files/lib/system/database/Redis.class.php | 6 ++++++ .../lib/system/email/SimpleEmail.class.php | 3 +++ .../html/input/HtmlInputProcessor.class.php | 5 +++++ .../html/input/node/HtmlInputNodeImg.class.php | 17 +++++++++++++++++ .../input/node/HtmlInputNodeProcessor.class.php | 5 +++++ ...HtmlInputNodeWoltlabMetacodeMarker.class.php | 6 ++++++ ...DecoratedCategoryLookupPageHandler.class.php | 13 +++++++++++++ .../TDecoratedCategoryMenuPageHandler.class.php | 5 +++++ ...dCategoryOnlineLocationPageHandler.class.php | 5 +++++ .../handler/TUserLookupPageHandler.class.php | 9 +++++++++ .../TUserOnlineLocationPageHandler.class.php | 10 ++++++++++ 14 files changed, 105 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/TMessageQuickReplyGuestDialogAction.class.php b/wcfsetup/install/files/lib/data/TMessageQuickReplyGuestDialogAction.class.php index e68f49e920..9e9ff02c08 100644 --- a/wcfsetup/install/files/lib/data/TMessageQuickReplyGuestDialogAction.class.php +++ b/wcfsetup/install/files/lib/data/TMessageQuickReplyGuestDialogAction.class.php @@ -35,6 +35,11 @@ trait TMessageQuickReplyGuestDialogAction { //protected $parameters = []; /** + * Reads a string value and validates it. + * + * @param string $variableName + * @param boolean $allowEmpty + * @param string $arrayIndex * @see AbstractDatabaseObjectAction::readString() */ abstract protected function readString($variableName, $allowEmpty = false, $arrayIndex = ''); diff --git a/wcfsetup/install/files/lib/data/poll/option/PollOption.class.php b/wcfsetup/install/files/lib/data/poll/option/PollOption.class.php index 572628f8da..59389aaeec 100644 --- a/wcfsetup/install/files/lib/data/poll/option/PollOption.class.php +++ b/wcfsetup/install/files/lib/data/poll/option/PollOption.class.php @@ -27,7 +27,7 @@ class PollOption extends DatabaseObject { /** * Returns relative amount of votes for this option. * - * @param Poll + * @param Poll $poll * @return integer */ public function getRelativeVotes(Poll $poll) { diff --git a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php index 7ea25ef14b..e9fd57afab 100644 --- a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php +++ b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php @@ -36,6 +36,11 @@ class Smiley extends DatabaseObject { return WCF::getPath().$this->smileyPath; } + /** + * Returns the url to the 2x version of the smiley. + * + * @return string + */ public function getURL2x() { return ($this->smileyPath2x) ? WCF::getPath().$this->smileyPath2x : ''; } @@ -51,6 +56,11 @@ class Smiley extends DatabaseObject { return explode("\n", StringUtil::unifyNewlines($this->aliases)); } + /** + * Returns the height of the smiley. + * + * @return integer + */ public function getHeight() { if ($this->height === null) { $this->height = 0; @@ -68,6 +78,11 @@ class Smiley extends DatabaseObject { return $this->height; } + /** + * Returns the html code to render the smiley. + * + * @return string + */ public function getHtml() { $srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : ''; $height = ($this->getHeight()) ? ' height="' . $this->getHeight() . '"' : ''; diff --git a/wcfsetup/install/files/lib/system/database/Redis.class.php b/wcfsetup/install/files/lib/system/database/Redis.class.php index 17026d4927..26af38217e 100644 --- a/wcfsetup/install/files/lib/system/database/Redis.class.php +++ b/wcfsetup/install/files/lib/system/database/Redis.class.php @@ -38,6 +38,8 @@ class Redis { /** * Connects to the redis server given by the DSN. + * + * @param string $dsn */ public function __construct($dsn) { if (!class_exists('Redis')) { @@ -80,6 +82,10 @@ class Redis { /** * Passes all method calls down to the underlying Redis connection. + * + * @param string $name + * @param array $arguments + * @return mixed */ public function __call($name, array $arguments) { switch ($name) { diff --git a/wcfsetup/install/files/lib/system/email/SimpleEmail.class.php b/wcfsetup/install/files/lib/system/email/SimpleEmail.class.php index 37eac61082..6f467bf817 100644 --- a/wcfsetup/install/files/lib/system/email/SimpleEmail.class.php +++ b/wcfsetup/install/files/lib/system/email/SimpleEmail.class.php @@ -41,6 +41,9 @@ class SimpleEmail { } /** + * Sets the email's 'Subject'. + * + * @param string $subject * @see Email::setSubject() */ public function setSubject($subject) { diff --git a/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php index 0a1019cc11..26fbcb370b 100644 --- a/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php @@ -105,6 +105,11 @@ class HtmlInputProcessor extends AbstractHtmlProcessor { return $this->getHtmlInputNodeProcessor()->validate(); } + /** + * Enforces the maximum depth of nested quotes. + * + * @param integer $depth + */ public function enforceQuoteDepth($depth) { $this->getHtmlInputNodeProcessor()->enforceQuoteDepth($depth); } diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php index d0698d47ec..3c5a2ef16a 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php @@ -68,6 +68,12 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode { } } + /** + * Replaces image element with attachment metacode element. + * + * @param \DOMElement $element + * @param string $class + */ protected function handleAttachment(\DOMElement $element, $class) { $attachmentID = intval($element->getAttribute('data-attachment-id')); if (!$attachmentID) { @@ -97,6 +103,12 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode { DOMUtil::replaceElement($element, $newElement, false); } + /** + * Replaces image element with media metacode element. + * + * @param \DOMElement $element + * @param string $class + */ protected function handleMedium(\DOMElement $element, $class) { $mediumID = intval($element->getAttribute('data-media-id')); if (!$mediumID) { @@ -126,6 +138,11 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode { DOMUtil::replaceElement($element, $newElement, false); } + /** + * Replaces image element with smiley metacode element. + * + * @param \DOMElement $element + */ protected function handleSmiley(\DOMElement $element) { $code = $element->getAttribute('alt'); diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index 7e48c57bd0..dd17ca263c 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -112,6 +112,11 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor { EventHandler::getInstance()->fireAction($this, 'afterProcess'); } + /** + * Enforces the maximum depth of nested quotes. + * + * @param integer $depth + */ public function enforceQuoteDepth($depth) { $quotes = []; /** @var \DOMElement $quote */ diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php index 6e3468c97d..6cfa65a09e 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php @@ -105,6 +105,12 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { return $groups; } + /** + * Returns `true` if the given element is inside a code element. + * + * @param \DOMElement $element + * @return boolean + */ protected function isInsideCode(\DOMElement $element) { $parent = $element; while ($parent = $parent->parentNode) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php index 72e4c5d16e..e77d67a255 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php @@ -29,6 +29,10 @@ trait TDecoratedCategoryLookupPageHandler { abstract protected function getDecoratedCategoryClass(); /** + * Returns the link for a page with an object id. + * + * @param integer $objectID page object id + * @return string page url * @see ILookupPageHandler::getLink() */ public function getLink($objectID) { @@ -46,6 +50,10 @@ trait TDecoratedCategoryLookupPageHandler { } /** + * Returns true if provided object id exists and is valid. + * + * @param integer $objectID page object id + * @return boolean true if object id is valid * @see ILookupPageHandler::isValid() */ public function isValid($objectID = null) { @@ -56,6 +64,11 @@ trait TDecoratedCategoryLookupPageHandler { } /** + * Performs a search for pages using a query string, returning an array containing + * an `objectID => title` relation. + * + * @param string $searchString search string + * @return string[] * @see ILookupPageHandler::lookup() */ public function lookup($searchString) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryMenuPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryMenuPageHandler.class.php index 1e8042e4df..e6efe36bfc 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryMenuPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryMenuPageHandler.class.php @@ -21,6 +21,11 @@ trait TDecoratedCategoryMenuPageHandler { abstract protected function getDecoratedCategoryClass(); /** + * Returns false if this page should be hidden from menus, but does not control the accessibility + * of the page itself. The visibility can optionally be scoped to the given object id. + * + * @param integer|null $objectID optional page object id + * @return boolean false if the page should be hidden from menus * @see IMenuPageHandler::isVisible() */ public function isVisible($objectID = null) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryOnlineLocationPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryOnlineLocationPageHandler.class.php index ed3f48ff28..5bd69a3cde 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryOnlineLocationPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryOnlineLocationPageHandler.class.php @@ -27,6 +27,11 @@ trait TDecoratedCategoryOnlineLocationPageHandler { abstract protected function getDecoratedCategoryClass(); /** + * Returns the textual description if a user is currently online viewing this page. + * + * @param Page $page visited page + * @param UserOnline $user user online object with request data + * @return string * @see IOnlineLocationPageHandler::getOnlineLocation() */ public function getOnlineLocation(Page $page, UserOnline $user) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TUserLookupPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TUserLookupPageHandler.class.php index 7b83467816..e09fa49cb0 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TUserLookupPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TUserLookupPageHandler.class.php @@ -14,6 +14,10 @@ use wcf\system\cache\runtime\UserRuntimeCache; */ trait TUserLookupPageHandler { /** + * Returns true if provided object id exists and is valid. + * + * @param integer $objectID page object id + * @return boolean true if object id is valid * @see ILookupPageHandler::isValid() */ public function isValid($objectID) { @@ -21,6 +25,11 @@ trait TUserLookupPageHandler { } /** + * Performs a search for pages using a query string, returning an array containing + * an `objectID => title` relation. + * + * @param string $searchString search string + * @return string[] * @see ILookupPageHandler::lookup() */ public function lookup($searchString) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TUserOnlineLocationPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TUserOnlineLocationPageHandler.class.php index 6ef6170b04..c2a2f710ba 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TUserOnlineLocationPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TUserOnlineLocationPageHandler.class.php @@ -18,6 +18,11 @@ trait TUserOnlineLocationPageHandler { use TOnlineLocationPageHandler; /** + * Returns the textual description if a user is currently online viewing this page. + * + * @param Page $page visited page + * @param UserOnline $user user online object with request data + * @return string * @see IOnlineLocationPageHandler::getOnlineLocation() */ public function getOnlineLocation(Page $page, UserOnline $user) { @@ -34,6 +39,11 @@ trait TUserOnlineLocationPageHandler { } /** + * Prepares fetching all necessary data for the textual description if a user is currently online + * viewing this page. + * + * @param Page $page visited page + * @param UserOnline $user user online object with request data * @see IOnlineLocationPageHandler::prepareOnlineLocation() */ public function prepareOnlineLocation(/** @noinspection PhpUnusedParameterInspection */Page $page, UserOnline $user) { -- 2.20.1