diff --git a/Sources/Actions/Admin/Smileys.php b/Sources/Actions/Admin/Smileys.php index 7ca35b4897..46442032e7 100644 --- a/Sources/Actions/Admin/Smileys.php +++ b/Sources/Actions/Admin/Smileys.php @@ -2561,7 +2561,8 @@ protected function import(string $smileyPath, bool $create = false): void } /** - * + * @param string $dir The directory to create + * @param string $name The name of the set */ protected function createDir(string $dir, string $name): void { @@ -2593,7 +2594,9 @@ protected function createDir(string $dir, string $name): void } /** - * + * @param string $name The desired name for the file + * @param string $tmp_name The temporary name for the file + * @return bool Whether this is a valid image file */ protected function validateImage(string $name, string $tmp_name): bool { @@ -2601,7 +2604,10 @@ protected function validateImage(string $name, string $tmp_name): bool } /** - * + * @param string $name The desired name of the file + * @param string $tmp_name The temporary name of the file + * @param array $destination_dirs An array of one or more directories to move this image to + * @return array An array of information about the files that were moved */ protected function moveImageIntoPlace(string $name, string $tmp_name, array $destination_dirs): array { @@ -2695,7 +2701,7 @@ protected static function getKnownSmileySets(): void } /** - * + * Saves the list of known smiley sets */ protected static function saveSets(): void { @@ -2723,7 +2729,9 @@ protected static function saveSets(): void } /** - * + * Sanitizes the string and trims unnecessary whitespace. + * @var string $string The string to sanitize + * @return string The sanitized string */ protected static function sanitizeString(string $string): string { diff --git a/Sources/Actions/Announce.php b/Sources/Actions/Announce.php index e8f43fc248..d92718c450 100644 --- a/Sources/Actions/Announce.php +++ b/Sources/Actions/Announce.php @@ -84,7 +84,7 @@ public function execute(): void } /** - * + * Handles selecting which groups to send the announcement to */ public function select(): void { @@ -127,7 +127,7 @@ public function select(): void } /** - * + * Sends the announcement email */ public function send(): void { diff --git a/Sources/Actions/Feed.php b/Sources/Actions/Feed.php index fe0653ac27..8c60025b4f 100644 --- a/Sources/Actions/Feed.php +++ b/Sources/Actions/Feed.php @@ -2950,6 +2950,11 @@ public static function cdataParse(string $data, string $ns = '', bool $force = f * Internal methods ******************/ + /** + * Sets the subaction property + * + * @param ?string $subaction The subaction. If not set, checks $_GET['sa'] first, then picks the first value in self::$subactions + */ protected function setSubaction(?string $subaction): void { if (isset($subaction, self::$subactions[$subaction])) { @@ -2961,6 +2966,11 @@ protected function setSubaction(?string $subaction): void } } + /** + * Sets the member property. This is the ID of the person viewing it or the person whose profile feed we're viewing + * + * @param ?int The member ID + */ protected function setMember(?int $member = 0): void { // Member ID was passed to the constructor. @@ -2984,6 +2994,9 @@ protected function setMember(?int $member = 0): void Utils::$context['xmlnews_uid'] = $this->member; } + /** + * Sets the format based on $_GET['type'] + */ protected function setFormat(): void { if (isset($_GET['type'], self::XML_NAMESPACES[$_GET['type']])) { @@ -2991,6 +3004,9 @@ protected function setFormat(): void } } + /** + * Sets the limit for determining how many items to show + */ protected function setlimit(): void { // Limit was set via Utils::$context. @@ -3009,6 +3025,9 @@ protected function setlimit(): void Utils::$context['xmlnews_limit'] = $this->limit; } + /** + * Checks whether feeds are enabled + */ protected function checkEnabled(): void { // Users can always export their own profile data. diff --git a/Sources/Actions/Moderation/Logs.php b/Sources/Actions/Moderation/Logs.php index e8cec20ff1..430a0a2736 100644 --- a/Sources/Actions/Moderation/Logs.php +++ b/Sources/Actions/Moderation/Logs.php @@ -180,28 +180,28 @@ class Logs implements ActionInterface /** * @var array * - * + * An array of search parameters */ protected array $search_params; /** * @var string * - * + * The search parameters string */ protected string $search_params_string; /** * @var string * - * + * The column being searched */ protected string $search_params_column; /** * @var string * - * + * URL-encoded search params */ protected string $encoded_search_params; @@ -229,7 +229,8 @@ public function execute(): void } /** - * + * Handles the admin log. + * @uses createList() */ public function adminlog(): void { @@ -243,7 +244,8 @@ public function adminlog(): void } /** - * + * Handles the moderation log + * @uses createList() */ public function modlog(): void { @@ -664,7 +666,7 @@ protected function __construct() } /** - * + * Sets up the search */ protected function setupSearch(): void { @@ -713,7 +715,7 @@ protected function setupSearch(): void } /** - * + * Handles deleting log entries */ protected function deleteEntries(): void { @@ -725,7 +727,7 @@ protected function deleteEntries(): void } /** - * + * Handles deleting all entries in either the mod or admin logs */ protected function deleteAll(): void { @@ -748,7 +750,7 @@ protected function deleteAll(): void } /** - * + * Deletes a single log entry */ protected function deleteEntry(): void { @@ -773,7 +775,7 @@ protected function deleteEntry(): void } /** - * + * Sets up all the information for the admin or mod log */ protected function createList(): void { diff --git a/Sources/Actions/Moderation/ReportedContent.php b/Sources/Actions/Moderation/ReportedContent.php index cc4c5e90c7..4078aaac96 100644 --- a/Sources/Actions/Moderation/ReportedContent.php +++ b/Sources/Actions/Moderation/ReportedContent.php @@ -1308,7 +1308,7 @@ protected function deleteModComment(int $comment_id): void } /** - * + * Sets up information for the quick buttons for each report */ protected function buildQuickButtons(): void { diff --git a/Sources/Actions/Notify.php b/Sources/Actions/Notify.php index de720999df..e2e60ef758 100644 --- a/Sources/Actions/Notify.php +++ b/Sources/Actions/Notify.php @@ -375,7 +375,7 @@ protected function setMode(): void } /** - * + * Handles loading the notification settings page */ protected function ask(): void { diff --git a/Sources/Actions/Post.php b/Sources/Actions/Post.php index 2c77f392b8..75c55bdca4 100644 --- a/Sources/Actions/Post.php +++ b/Sources/Actions/Post.php @@ -577,7 +577,7 @@ protected function loadTopic(): void } /** - * + * Sets up various Utils::$context variables for the template when replying to a topic */ protected function initiateReply(): void { @@ -638,7 +638,7 @@ protected function initiateReply(): void } /** - * + * Sets up the form for posting a new topic */ protected function initiateNewTopic(): void { @@ -665,7 +665,7 @@ protected function initiateNewTopic(): void } /** - * + * Sets up the form for creating a new topic with a poll */ protected function initiatePoll(): void { @@ -687,7 +687,7 @@ protected function initiatePoll(): void } /** - * + * Sets up the form for creating a new event */ protected function initiateEvent(): void { @@ -784,7 +784,7 @@ protected function initiateEvent(): void } /** - * + * Checks whether any new replies have been posted while the user was typing and warns them if so */ protected function checkForNewReplies(): void { @@ -831,7 +831,7 @@ protected function checkForNewReplies(): void } /** - * + * Handles setting the response prefix */ protected function setResponsePrefix(): void { @@ -848,7 +848,7 @@ protected function setResponsePrefix(): void } /** - * + * Handles previewing a post */ protected function showPreview(): void { @@ -1066,7 +1066,7 @@ protected function showPreview(): void } /** - * + * Shows the form for editing a post */ protected function showEdit(): void { @@ -1161,7 +1161,7 @@ protected function showEdit(): void } /** - * + * Shows the form for creating a new post */ protected function showNew(): void { @@ -1263,7 +1263,7 @@ function ($m) { } /** - * + * Handles showing attachments and setting up information for the attachments interface */ protected function showAttachments(): void { @@ -1556,7 +1556,7 @@ function ($val) { } /** - * + * Shows the verification control if necessary */ protected function showVerification(): void { @@ -1573,7 +1573,7 @@ protected function showVerification(): void } /** - * + * Checks for any errors */ protected function checkForErrors(): void { @@ -1608,7 +1608,7 @@ protected function checkForErrors(): void } /** - * + * Sets the page title based on what the user is doing */ protected function setPageTitle(): void { @@ -1628,7 +1628,7 @@ protected function setPageTitle(): void } /** - * + * Sets up the linktree info for the template */ protected function setLinktree(): void { @@ -1647,7 +1647,7 @@ protected function setLinktree(): void } /** - * + * Handles loading drafts */ protected function loadDrafts(): void { @@ -1690,7 +1690,7 @@ protected function loadEditor(): void } /** - * + * Gets information about available message icons for the template */ protected function setMessageIcons(): void { @@ -1736,7 +1736,7 @@ protected function setMessageIcons(): void } /** - * + * Sets up information about each of the form fields */ protected function setupPostingFields(): void { diff --git a/Sources/Actions/Post2.php b/Sources/Actions/Post2.php index 472b279710..7b88f9e15f 100644 --- a/Sources/Actions/Post2.php +++ b/Sources/Actions/Post2.php @@ -703,7 +703,7 @@ protected function __construct() } /** - * + * Displays a visual verification control if necessary */ protected function checkVerification(): void { @@ -725,7 +725,7 @@ protected function checkVerification(): void } /** - * + * Handles adding/updating/deleting attachments */ protected function submitAttachments(): void { @@ -791,7 +791,7 @@ protected function submitAttachments(): void } /** - * + * Handles various checks when submitting a new reply - permissions, possible errors, etc. */ protected function prepareNewReply(): void { @@ -881,7 +881,7 @@ protected function prepareNewReply(): void } /** - * + * Handles various checks when submitting a new topic */ protected function prepareNewTopic(): void { @@ -931,7 +931,7 @@ protected function prepareNewTopic(): void } /** - * + * Handles various checks when editing an existing post */ protected function prepareEdit(): void { diff --git a/Sources/Actions/Profile/BackwardCompatibility.php b/Sources/Actions/Profile/BackwardCompatibility.php index ba64587373..86872c915f 100644 --- a/Sources/Actions/Profile/BackwardCompatibility.php +++ b/Sources/Actions/Profile/BackwardCompatibility.php @@ -24,12 +24,14 @@ trait BackwardCompatibility /** * - * @param int $memID - * @param null|string $sa - * @param bool $updateRequest - * @param bool $loadSelfFirst - * @param bool $loadProfile - * @param bool $defaultSettings + * Backwards compatibility function for handling profile-related subactions + * + * @param int $memID The member ID + * @param null|string $sa The subaction + * @param bool $updateRequest Whether to update $_REQUEST['u'] + * @param bool $loadSelfFirst Whether to load the current user's profile first + * @param bool $loadProfile Whether to load the profile of the specified member + * @param bool $defaultSettings Not used? */ public static function subActionProvider( int $memID, diff --git a/Sources/Actions/Profile/GroupMembership.php b/Sources/Actions/Profile/GroupMembership.php index 984d89fe01..95868b4a0b 100644 --- a/Sources/Actions/Profile/GroupMembership.php +++ b/Sources/Actions/Profile/GroupMembership.php @@ -295,7 +295,7 @@ protected function __construct() } /** - * + * Loads an array of information about groups the user is in and any they can join */ protected function loadCurrentAndAssignableGroups(): void { @@ -364,7 +364,7 @@ protected function canEditPrimary(?int $new_group_id = null): bool } /** - * + * Handles submitting a user's request to join a group */ protected function sendJoinRequest(int $new_group_id): void { diff --git a/Sources/Actions/Profile/ShowPosts.php b/Sources/Actions/Profile/ShowPosts.php index 4c0d4efa40..3fbd0cf455 100644 --- a/Sources/Actions/Profile/ShowPosts.php +++ b/Sources/Actions/Profile/ShowPosts.php @@ -653,7 +653,9 @@ protected function deletePost(): void } /** + * Loads a user's posts or topics * + * @param bool $is_topics Whether to load topics instead of posts */ protected function loadPosts(bool $is_topics = false): void { diff --git a/Sources/Actions/ReportToMod.php b/Sources/Actions/ReportToMod.php index c3afae57f2..fc3325967d 100644 --- a/Sources/Actions/ReportToMod.php +++ b/Sources/Actions/ReportToMod.php @@ -245,7 +245,7 @@ public function show(): void } /** - * + * Checks the input, session, etc. and submits the form */ public function submit(): void { diff --git a/Sources/Actions/Unread.php b/Sources/Actions/Unread.php index cb314b105a..c79814c549 100644 --- a/Sources/Actions/Unread.php +++ b/Sources/Actions/Unread.php @@ -960,7 +960,7 @@ protected function getTopics(): void } /** - * + * Sets up information about buttons for the template */ protected function buildButtons(): void { diff --git a/Sources/PackageManager/SubsPackage.php b/Sources/PackageManager/SubsPackage.php index 1e25fefccd..d26266709a 100644 --- a/Sources/PackageManager/SubsPackage.php +++ b/Sources/PackageManager/SubsPackage.php @@ -2909,9 +2909,11 @@ public static function package_crypt( } /** - * @param string $dir + * Generates a unique filename for the specified file in the specified directory + * + * @param string $dir The directory * @param string $filename The filename without an extension - * @param string $ext + * @param string $ext The extension * @return string The filename with a number appended but no extension * @since 2.1 */ diff --git a/Sources/Search/SearchApi.php b/Sources/Search/SearchApi.php index 47afdf7cac..ae9c2d4830 100644 --- a/Sources/Search/SearchApi.php +++ b/Sources/Search/SearchApi.php @@ -1293,7 +1293,10 @@ protected function setSearchTerms(): void } /** - * + * Wraps the given string in regex to set a word boundary + * + * @param string $str The string + * @return string */ protected function wordBoundaryWrapper(string $str): string { @@ -1301,7 +1304,10 @@ protected function wordBoundaryWrapper(string $str): string } /** - * + * Uses regex to escape SQL in the given string + * + * @param string $str The string to escape + * @return string The escaped string */ protected function escapeSqlRegex(string $str): string { @@ -1309,7 +1315,7 @@ protected function escapeSqlRegex(string $str): string } /** - * + * Finds the lowest and highest message ID based on the given min and/or max age */ protected function setMsgBounds(): void { @@ -1338,7 +1344,7 @@ protected function setMsgBounds(): void } /** - * + * Sets $this->userQuery based on given params */ protected function setUserQuery(): void { @@ -1418,7 +1424,7 @@ protected function setUserQuery(): void } /** - * + * Sets $this->boardQuery based on the given params */ protected function setBoardQuery(): void { @@ -1557,7 +1563,7 @@ protected function setSort(): void } /** - * + * Handles searching for posts in the subject only */ protected function searchSubjectOnly(): void { @@ -1732,7 +1738,7 @@ protected function searchSubjectOnly(): void } /** - * + * Handles searching both in the subject and message text */ protected function searchSubjectAndMessage() {