1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-24 17:13:01 +00:00

bool -> boolean

This commit is contained in:
Starbeamrainbowlabs 2020-01-05 20:59:21 +00:00
parent 4b40cf7c19
commit b4c0782e58
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
9 changed files with 15 additions and 15 deletions

View file

@ -713,7 +713,7 @@ function extract_user_from_userpage($userPagename) {
* @param string $body The body of the email. * @param string $body The body of the email.
* @return bool Whether the email was sent successfully or not. Currently, this may fail if the user doesn't have a registered email address. * @return bool Whether the email was sent successfully or not. Currently, this may fail if the user doesn't have a registered email address.
*/ */
function email_user(string $username, string $subject, string $body) : boolean function email_user(string $username, string $subject, string $body) : bool
{ {
global $version, $env, $settings; global $version, $env, $settings;

View file

@ -172,10 +172,10 @@
{ {
"id": "feature-user-preferences", "id": "feature-user-preferences",
"name": "User Preferences", "name": "User Preferences",
"version": "0.3.4", "version": "0.4",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a user preferences page, letting people do things like change their email address and password.", "description": "Adds a user preferences page, letting people do things like change their email address and password.",
"lastupdate": 1578257121, "lastupdate": 1578257835,
"optional": false, "optional": false,
"extra_data": [] "extra_data": []
}, },

View file

@ -13,7 +13,7 @@ register_module([
* @apiPermission Anonymous * @apiPermission Anonymous
* *
* @apiParam {string} string The string to hash. * @apiParam {string} string The string to hash.
* @apiParam {boolean} raw Whether to return the hashed password as a raw string instead of as part of an HTML page. * @apiParam {bool} raw Whether to return the hashed password as a raw string instead of as part of an HTML page.
* *
* @apiError ParamNotFound The string parameter was not specified. * @apiError ParamNotFound The string parameter was not specified.
*/ */

View file

@ -13,7 +13,7 @@ register_module([
* @apiGroup Stats * @apiGroup Stats
* @apiPermission Anonymous * @apiPermission Anonymous
* *
* @apiParam {boolean} Whether or not the result should be minified JSON. Default: false * @apiParam {bool} Whether or not the result should be minified JSON. Default: false
*/ */
/* /*

View file

@ -172,7 +172,7 @@ SCRIPT;
else else
$configValue = $_POST[$configKey]; $configValue = $_POST[$configKey];
// Convert boolean settings to a boolean, since POST // Convert bool settings to a bool, since POST
// parameters don't decode correctly. // parameters don't decode correctly.
if(is_bool($settings->$configKey)) if(is_bool($settings->$configKey))
$configValue = in_array($configValue, [ 1, "on"], true) ? true : false; $configValue = in_array($configValue, [ 1, "on"], true) ? true : false;

View file

@ -136,7 +136,7 @@ function interwiki_get_pagename_url($interwiki_pagename) {
* Note that this doesn't guarantee that it's a _valid_ interwiki link - only that it looks like one :P * Note that this doesn't guarantee that it's a _valid_ interwiki link - only that it looks like one :P
* @package interwiki-links * @package interwiki-links
* @param string $pagename The page name to check. * @param string $pagename The page name to check.
* @return boolean Whether the given page name is an interwiki link or not. * @return bool Whether the given page name is an interwiki link or not.
*/ */
function is_interwiki_link($pagename) { function is_interwiki_link($pagename) {
return strpos($pagename, ":") !== false; return strpos($pagename, ":") !== false;

View file

@ -234,8 +234,8 @@ register_module([
/** /**
* Updates the wiki's statistics. * Updates the wiki's statistics.
* @package feature-stats * @package feature-stats
* @param boolean $update_all Whether all the statistics should be checked and recalculated, or just as many as we have time for according to the settings. * @param bool $update_all Whether all the statistics should be checked and recalculated, or just as many as we have time for according to the settings.
* @param boolean $force Whether we should recalculate statistics that don't currently require recalculating anyway. * @param bool $force Whether we should recalculate statistics that don't currently require recalculating anyway.
*/ */
function update_statistics($update_all = false, $force = false) function update_statistics($update_all = false, $force = false)
{ {

View file

@ -13,7 +13,7 @@ register_module([
* @apiGroup Upload * @apiGroup Upload
* @apiPermission User * @apiPermission User
* *
* @apiParam {boolean} avatar Optional. If true then a special page to upload your avatar is displayed instead. * @apiParam {bool} avatar Optional. If true then a special page to upload your avatar is displayed instead.
*/ */
/** /**
@ -25,7 +25,7 @@ register_module([
* @apiParam {string} name The name of the file to upload. * @apiParam {string} name The name of the file to upload.
* @apiParam {string} description A description of the file. * @apiParam {string} description A description of the file.
* @apiParam {file} file The file to upload. * @apiParam {file} file The file to upload.
* @apiParam {boolean} avatar Whether this upload should be uploaded as the current user's avatar. If specified, any filenames provided will be ignored. * @apiParam {bool} avatar Whether this upload should be uploaded as the current user's avatar. If specified, any filenames provided will be ignored.
* *
* @apiUse UserNotLoggedInError * @apiUse UserNotLoggedInError
* @apiError UploadsDisabledError Uploads are currently disabled in the wiki's settings. * @apiError UploadsDisabledError Uploads are currently disabled in the wiki's settings.

View file

@ -50,7 +50,7 @@ register_module([
} }
if(has_action("watchlist") && module_exists("feature-watchlist")) { if(has_action("watchlist") && module_exists("feature-watchlist")) {
$content .= "<p><em>Looking for your watchlist? Find it <a href='?action=watchlist'>here</a>!</p>"; $content .= "<p><em>Looking for your watchlist? Find it <a href='?action=watchlist'>here</a>!</em></p>";
} }
// If avatar support is present, allow the user to upload a new avatar // If avatar support is present, allow the user to upload a new avatar
@ -67,7 +67,7 @@ register_module([
$content .= " <input type='email' id='email-address' name='email-address' placeholder='e.g. bob@bobsrockets.com' value='{$env->user_data->emailAddress}' />\n"; $content .= " <input type='email' id='email-address' name='email-address' placeholder='e.g. bob@bobsrockets.com' value='{$env->user_data->emailAddress}' />\n";
$content .= " <p><small>Used to send you notifications etc. Never shared with anyone except $settings->admindetails_name, $settings->sitename's administrator.</small></p>\n"; $content .= " <p><small>Used to send you notifications etc. Never shared with anyone except $settings->admindetails_name, $settings->sitename's administrator.</small></p>\n";
if($settings->email_user_verify) { if($settings->email_user_verify) {
$content .= " <p>Email verification status: ".(!empty($env->user_data->emailAddressVerificationCode) || !$env->user_data->emailAddressVerificationCode ? "not " : "")."verified <em>Email address verification is required in order to receive emails (other than the verification email itself, of course). Click the link in the verification email sent to you to verify your address, or change it here to get another verification email.</em></p>"; $content .= " <p>Email verification status: <strong>".(empty($env->user_data->emailAddressVerificationCode) ? "not " : "")."verified</strong> <small><em>(Email address verification is required in order to receive emails (other than the verification email itself, of course). Click the link in the verification email sent to you to verify your address, or change it here to get another verification email)</em></small></p>";
} }
$content .= " <input type='submit' value='Save Preferences' />\n"; $content .= " <input type='submit' value='Save Preferences' />\n";
$content .= "</form>\n"; $content .= "</form>\n";
@ -303,9 +303,9 @@ register_module([
* If a user does not need to verify their email address, no verification email * If a user does not need to verify their email address, no verification email
* is sent and true is returned. * is sent and true is returned.
* @param string $username The name of the user to send the verification code to. * @param string $username The name of the user to send the verification code to.
* @return boolean Whether the verification code was sent successfully. If a user does not need to verify their email address, this returns true. * @return bool Whether the verification code was sent successfully. If a user does not need to verify their email address, this returns true.
*/ */
function email_user_verify(string $username) : boolean { function email_user_verify(string $username) : bool {
global $settings; global $settings;
$user_data = $settings->users->$username; $user_data = $settings->users->$username;