PHPDoc comment matches function/method signature.

This commit is contained in:
Yuriy Pikhtarev 2017-05-05 01:02:36 +03:00
commit 061c6d5fe8
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
17 changed files with 256 additions and 3 deletions

View file

@ -1112,6 +1112,9 @@ function check_name_dup($mode, $name, $die_on_error = true)
/** /**
* Change subforums cat_id if parent's cat_id was changed * Change subforums cat_id if parent's cat_id was changed
* @param $parent_id
* @param $new_cat_id
* @param $order_shear
*/ */
function change_sf_cat($parent_id, $new_cat_id, $order_shear) function change_sf_cat($parent_id, $new_cat_id, $order_shear)
{ {

View file

@ -211,6 +211,8 @@ class ajax_common
/** /**
* Exit on error * Exit on error
* @param $error_msg
* @param int $error_code
*/ */
public function ajax_die($error_msg, $error_code = E_AJAX_GENERAL_ERROR) public function ajax_die($error_msg, $error_code = E_AJAX_GENERAL_ERROR)
{ {
@ -246,6 +248,8 @@ class ajax_common
/** /**
* OB Handler * OB Handler
* @param $contents
* @return string
*/ */
public function ob_handler($contents): string public function ob_handler($contents): string
{ {
@ -300,6 +304,7 @@ class ajax_common
/** /**
* Prompt for confirmation * Prompt for confirmation
* @param $confirm_msg
*/ */
public function prompt_for_confirm($confirm_msg) public function prompt_for_confirm($confirm_msg)
{ {
@ -314,6 +319,7 @@ class ajax_common
/** /**
* Verify mod rights * Verify mod rights
* @param $forum_id
*/ */
public function verify_mod_rights($forum_id) public function verify_mod_rights($forum_id)
{ {

View file

@ -39,6 +39,8 @@ if (defined('ATTACH_INSTALL')) {
/** /**
* wrapper function for determining the correct language directory * wrapper function for determining the correct language directory
* @param $language_file
* @return
*/ */
function attach_mod_get_lang($language_file) function attach_mod_get_lang($language_file)
{ {

View file

@ -57,6 +57,9 @@ function init_complete_extensions_data()
/** /**
* Writing Data into plain Template Vars * Writing Data into plain Template Vars
* @param $template_var
* @param $replacement
* @param string $filename
*/ */
function init_display_template($template_var, $replacement, $filename = 'viewtopic_attach.tpl') function init_display_template($template_var, $replacement, $filename = 'viewtopic_attach.tpl')
{ {
@ -102,6 +105,8 @@ function init_display_template($template_var, $replacement, $filename = 'viewtop
/** /**
* Display Attachments in Posts * Display Attachments in Posts
* @param $post_id
* @param $switch_attachment
*/ */
function display_post_attachments($post_id, $switch_attachment) function display_post_attachments($post_id, $switch_attachment)
{ {
@ -118,6 +123,7 @@ function display_post_attachments($post_id, $switch_attachment)
/** /**
* Initializes some templating variables for displaying Attachments in Posts * Initializes some templating variables for displaying Attachments in Posts
* @param $switch_attachment
*/ */
function init_display_post_attachments($switch_attachment) function init_display_post_attachments($switch_attachment)
{ {
@ -178,6 +184,7 @@ function init_display_post_attachments($switch_attachment)
* Assign Variables and Definitions based on the fetched Attachments - internal * Assign Variables and Definitions based on the fetched Attachments - internal
* used by all displaying functions, the Data was collected before, it's only dependend on the template used. :) * used by all displaying functions, the Data was collected before, it's only dependend on the template used. :)
* before this function is usable, init_display_attachments have to be called for specific pages (pm, posting, review etc...) * before this function is usable, init_display_attachments have to be called for specific pages (pm, posting, review etc...)
* @param $post_id
*/ */
function display_attachments($post_id) function display_attachments($post_id)
{ {

View file

@ -41,6 +41,8 @@ if (!function_exists('html_entity_decode')) {
/** /**
* A simple dectobase64 function * A simple dectobase64 function
* @param $number
* @return string|void
*/ */
function base64_pack($number) function base64_pack($number)
{ {
@ -72,6 +74,8 @@ function base64_pack($number)
/** /**
* base64todec function * base64todec function
* @param $string
* @return bool|int
*/ */
function base64_unpack($string) function base64_unpack($string)
{ {
@ -95,6 +99,8 @@ function base64_unpack($string)
/** /**
* Per Forum based Extension Group Permissions (Encode Number) -> Theoretically up to 158 Forums saveable. :) * Per Forum based Extension Group Permissions (Encode Number) -> Theoretically up to 158 Forums saveable. :)
* We are using a base of 64, but splitting it to one-char and two-char numbers. :) * We are using a base of 64, but splitting it to one-char and two-char numbers. :)
* @param $auth_array
* @return string
*/ */
function auth_pack($auth_array) function auth_pack($auth_array)
{ {
@ -121,6 +127,8 @@ function auth_pack($auth_array)
/** /**
* Reverse the auth_pack process * Reverse the auth_pack process
* @param $auth_cache
* @return array
*/ */
function auth_unpack($auth_cache) function auth_unpack($auth_cache)
{ {
@ -152,6 +160,9 @@ function auth_unpack($auth_cache)
/** /**
* Used for determining if Forum ID is authed, please use this Function on all Posting Screens * Used for determining if Forum ID is authed, please use this Function on all Posting Screens
* @param $auth_cache
* @param $check_forum_id
* @return bool
*/ */
function is_forum_authed($auth_cache, $check_forum_id) function is_forum_authed($auth_cache, $check_forum_id)
{ {
@ -189,6 +200,9 @@ function is_forum_authed($auth_cache, $check_forum_id)
/** /**
* Deletes an Attachment * Deletes an Attachment
* @param $filename
* @param bool $mode
* @return bool
*/ */
function unlink_attach($filename, $mode = false) function unlink_attach($filename, $mode = false)
{ {
@ -207,6 +221,8 @@ function unlink_attach($filename, $mode = false)
/** /**
* Check if Attachment exist * Check if Attachment exist
* @param $filename
* @return bool
*/ */
function attachment_exists($filename) function attachment_exists($filename)
{ {
@ -223,6 +239,8 @@ function attachment_exists($filename)
/** /**
* Check if Thumbnail exist * Check if Thumbnail exist
* @param $filename
* @return bool
*/ */
function thumbnail_exists($filename) function thumbnail_exists($filename)
{ {
@ -239,6 +257,8 @@ function thumbnail_exists($filename)
/** /**
* Physical Filename stored already ? * Physical Filename stored already ?
* @param $filename
* @return bool
*/ */
function physical_filename_already_stored($filename) function physical_filename_already_stored($filename)
{ {
@ -264,6 +284,8 @@ function physical_filename_already_stored($filename)
/** /**
* get all attachments from a post (could be an post array too) * get all attachments from a post (could be an post array too)
* @param $post_id_array
* @return array
*/ */
function get_attachments_from_post($post_id_array) function get_attachments_from_post($post_id_array)
{ {
@ -313,6 +335,8 @@ function get_attachments_from_post($post_id_array)
/** /**
* Count Filesize of Attachments in Database based on the attachment id * Count Filesize of Attachments in Database based on the attachment id
* @param $attach_ids
* @return int
*/ */
function get_total_attach_filesize($attach_ids) function get_total_attach_filesize($attach_ids)
{ {
@ -407,6 +431,8 @@ function attachment_sync_topic($topics)
/** /**
* Get Extension * Get Extension
* @param $filename
* @return string
*/ */
function get_extension($filename) function get_extension($filename)
{ {
@ -425,6 +451,8 @@ function get_extension($filename)
/** /**
* Delete Extension * Delete Extension
* @param $filename
* @return bool|string
*/ */
function delete_extension($filename) function delete_extension($filename)
{ {
@ -433,6 +461,9 @@ function delete_extension($filename)
/** /**
* Check if a user is within Group * Check if a user is within Group
* @param $user_id
* @param $group_id
* @return bool
*/ */
function user_in_group($user_id, $group_id) function user_in_group($user_id, $group_id)
{ {
@ -463,6 +494,8 @@ function user_in_group($user_id, $group_id)
/** /**
* Realpath replacement for attachment mod * Realpath replacement for attachment mod
* @param $path
* @return bool|string
*/ */
function amod_realpath($path) function amod_realpath($path)
{ {
@ -475,6 +508,10 @@ function amod_realpath($path)
* Set variable, used by {@link get_var the get_var function} * Set variable, used by {@link get_var the get_var function}
* *
* @private * @private
* @param $result
* @param $var
* @param $type
* @param bool $multibyte
*/ */
function _set_var(&$result, $var, $type, $multibyte = false) function _set_var(&$result, $var, $type, $multibyte = false)
{ {
@ -545,6 +582,8 @@ function get_var($var_name, $default, $multibyte = false)
/** /**
* Escaping SQL * Escaping SQL
* @param $text
* @return mixed|string
*/ */
function attach_mod_sql_escape($text) function attach_mod_sql_escape($text)
{ {
@ -560,6 +599,9 @@ function attach_mod_sql_escape($text)
* *
* Idea for this from Ikonboard * Idea for this from Ikonboard
* Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT * Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT
* @param $query
* @param bool $assoc_ary
* @return string
*/ */
function attach_mod_sql_build_array($query, $assoc_ary = false) function attach_mod_sql_build_array($query, $assoc_ary = false)
{ {

View file

@ -29,6 +29,10 @@
/** /**
* Delete Attachment(s) from post(s) (intern) * Delete Attachment(s) from post(s) (intern)
* @param int $post_id_array
* @param int $attach_id_array
* @param int $page
* @param int $user_id
*/ */
function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0) function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)
{ {

View file

@ -29,6 +29,8 @@
/** /**
* Read Long Int (4 Bytes) from File * Read Long Int (4 Bytes) from File
* @param $fp
* @return int
*/ */
function read_longint($fp) function read_longint($fp)
{ {
@ -44,6 +46,8 @@ function read_longint($fp)
/** /**
* Read Word (2 Bytes) from File - Note: It's an Intel Word * Read Word (2 Bytes) from File - Note: It's an Intel Word
* @param $fp
* @return int
*/ */
function read_word($fp) function read_word($fp)
{ {
@ -54,6 +58,8 @@ function read_word($fp)
/** /**
* Read Byte * Read Byte
* @param $fp
* @return int
*/ */
function read_byte($fp) function read_byte($fp)
{ {
@ -64,6 +70,8 @@ function read_byte($fp)
/** /**
* Get Image Dimensions * Get Image Dimensions
* @param $file
* @return array|bool
*/ */
function image_getdimension($file) function image_getdimension($file)
{ {

View file

@ -25,6 +25,8 @@
/** /**
* Setup s_auth_can in viewforum and viewtopic (viewtopic.php/viewforum.php) * Setup s_auth_can in viewforum and viewtopic (viewtopic.php/viewforum.php)
* @param $is_auth
* @param $s_auth_can
*/ */
function attach_build_auth_levels($is_auth, &$s_auth_can) function attach_build_auth_levels($is_auth, &$s_auth_can)
{ {
@ -41,6 +43,9 @@ function attach_build_auth_levels($is_auth, &$s_auth_can)
/** /**
* Called from admin_users.php and admin_groups.php in order to process Quota Settings (admin/admin_users.php:admin/admin_groups.php) * Called from admin_users.php and admin_groups.php in order to process Quota Settings (admin/admin_users.php:admin/admin_groups.php)
* @param $admin_mode
* @param bool $submit
* @param $mode
*/ */
function attachment_quota_settings($admin_mode, $submit = false, $mode) function attachment_quota_settings($admin_mode, $submit = false, $mode)
{ {

View file

@ -29,6 +29,9 @@
/** /**
* select group * select group
* @param $select_name
* @param int $default_group
* @return string
*/ */
function group_select($select_name, $default_group = 0) function group_select($select_name, $default_group = 0)
{ {
@ -68,6 +71,9 @@ function group_select($select_name, $default_group = 0)
/** /**
* select download mode * select download mode
* @param $select_name
* @param int $group_id
* @return string
*/ */
function download_select($select_name, $group_id = 0) function download_select($select_name, $group_id = 0)
{ {
@ -110,6 +116,9 @@ function download_select($select_name, $group_id = 0)
/** /**
* select category types * select category types
* @param $select_name
* @param int $group_id
* @return string
*/ */
function category_select($select_name, $group_id = 0) function category_select($select_name, $group_id = 0)
{ {
@ -162,6 +171,9 @@ function category_select($select_name, $group_id = 0)
/** /**
* Select size mode * Select size mode
* @param $select_name
* @param $size_compare
* @return string
*/ */
function size_select($select_name, $size_compare) function size_select($select_name, $size_compare)
{ {
@ -184,6 +196,9 @@ function size_select($select_name, $size_compare)
/** /**
* select quota limit * select quota limit
* @param $select_name
* @param int $default_quota
* @return string
*/ */
function quota_limit_select($select_name, $default_quota = 0) function quota_limit_select($select_name, $default_quota = 0)
{ {
@ -215,6 +230,9 @@ function quota_limit_select($select_name, $default_quota = 0)
/** /**
* select default quota limit * select default quota limit
* @param $select_name
* @param int $default_quota
* @return string
*/ */
function default_quota_limit_select($select_name, $default_quota = 0) function default_quota_limit_select($select_name, $default_quota = 0)
{ {

View file

@ -31,6 +31,9 @@ $imagick = '';
/** /**
* Calculate the needed size for Thumbnail * Calculate the needed size for Thumbnail
* @param $width
* @param $height
* @return array
*/ */
function get_img_size_format($width, $height) function get_img_size_format($width, $height)
{ {
@ -67,6 +70,8 @@ function is_imagick()
/** /**
* Get supported image types * Get supported image types
* @param $type
* @return array
*/ */
function get_supported_image_types($type) function get_supported_image_types($type)
{ {
@ -106,6 +111,10 @@ function get_supported_image_types($type)
/** /**
* Create thumbnail * Create thumbnail
* @param $source
* @param $new_file
* @param $mimetype
* @return bool
*/ */
function create_thumbnail($source, $new_file, $mimetype) function create_thumbnail($source, $new_file, $mimetype)
{ {

View file

@ -208,6 +208,8 @@ class attach_parent
/** /**
* Handle all modes... (intern) * Handle all modes... (intern)
* @private * @private
* @param $mode
* @return bool
*/ */
public function handle_attachments($mode): bool public function handle_attachments($mode): bool
{ {
@ -534,6 +536,10 @@ class attach_parent
/** /**
* Basic Insert Attachment Handling for all Message Types * Basic Insert Attachment Handling for all Message Types
* @param $mode
* @param $message_type
* @param $message_id
* @return bool
*/ */
public function do_insert_attachment($mode, $message_type, $message_id) public function do_insert_attachment($mode, $message_type, $message_id)
{ {
@ -1114,6 +1120,7 @@ class attach_posting extends attach_parent
/** /**
* Insert an Attachment into a Post (this is the second function called from posting.php) * Insert an Attachment into a Post (this is the second function called from posting.php)
* @param $post_id
*/ */
public function insert_attachment($post_id) public function insert_attachment($post_id)
{ {

View file

@ -287,10 +287,13 @@ function strip_quotes($text)
* Strips away bbcode from a given string, leaving plain text * Strips away bbcode from a given string, leaving plain text
* *
* @param string Text to be stripped of bbcode tags * @param string Text to be stripped of bbcode tags
* @param boolean If true, strip away quote tags AND their contents * @param bool $stripquotes
* @param boolean If true, use the fast-and-dirty method rather than the shiny and nice method * @param bool $fast_and_dirty
* @param bool $showlinks
* @return string
* @internal param If $boolean true, strip away quote tags AND their contents
* @internal param If $boolean true, use the fast-and-dirty method rather than the shiny and nice method
* *
* @return string
*/ */
function strip_bbcode($message, $stripquotes = true, $fast_and_dirty = false, $showlinks = true) function strip_bbcode($message, $stripquotes = true, $fast_and_dirty = false, $showlinks = true)
{ {
@ -518,6 +521,8 @@ class bbcode
/** /**
* bbcode2html * bbcode2html
* $text должен быть уже обработан htmlCHR($text, false, ENT_NOQUOTES); * $text должен быть уже обработан htmlCHR($text, false, ENT_NOQUOTES);
* @param $text
* @return string
*/ */
public function bbcode2html($text): string public function bbcode2html($text): string
{ {
@ -566,6 +571,8 @@ class bbcode
/** /**
* Clean up * Clean up
* @param $text
* @return mixed|string
*/ */
public static function clean_up($text) public static function clean_up($text)
{ {
@ -578,6 +585,8 @@ class bbcode
/** /**
* Spam filter * Spam filter
* @param $text
* @return mixed|string
*/ */
private function spam_filter($text) private function spam_filter($text)
{ {
@ -635,6 +644,8 @@ class bbcode
/** /**
* [code] callback * [code] callback
* @param $m
* @return string
*/ */
public function code_callback($m): string public function code_callback($m): string
{ {
@ -648,6 +659,8 @@ class bbcode
/** /**
* [url] callback * [url] callback
* @param $m
* @return string
*/ */
public function url_callback($m): string public function url_callback($m): string
{ {
@ -671,6 +684,8 @@ class bbcode
/** /**
* Escape tags inside tiltes in [quote="tilte"] * Escape tags inside tiltes in [quote="tilte"]
* @param $m
* @return string
*/ */
public function escape_tiltes_callback($m): string public function escape_tiltes_callback($m): string
{ {
@ -683,6 +698,8 @@ class bbcode
/** /**
* make_clickable * make_clickable
* @param $text
* @return bool|string
*/ */
public function make_clickable($text) public function make_clickable($text)
{ {
@ -713,6 +730,8 @@ class bbcode
/** /**
* make_url_clickable_callback * make_url_clickable_callback
* @param $m
* @return string
*/ */
public function make_url_clickable_callback($m): string public function make_url_clickable_callback($m): string
{ {
@ -733,6 +752,8 @@ class bbcode
/** /**
* smilies_pass * smilies_pass
* @param $text
* @return mixed
*/ */
public function smilies_pass($text) public function smilies_pass($text)
{ {
@ -751,6 +772,8 @@ class bbcode
/** /**
* new_line2html * new_line2html
* @param $text
* @return mixed
*/ */
public function new_line2html($text) public function new_line2html($text)
{ {
@ -761,6 +784,8 @@ class bbcode
/** /**
* tidy * tidy
* @param $text
* @return string
*/ */
public function tidy($text): string public function tidy($text): string
{ {
@ -807,6 +832,8 @@ class words_rate
/** /**
* возвращает "показатель полезности" сообщения используемый для автоудаления коротких сообщений типа "спасибо", "круто" и т.д. * возвращает "показатель полезности" сообщения используемый для автоудаления коротких сообщений типа "спасибо", "круто" и т.д.
* @param $text
* @return int
*/ */
public function get_words_rate($text): int public function get_words_rate($text): int
{ {

View file

@ -33,6 +33,10 @@ class cache_common
/** /**
* Returns value of variable * Returns value of variable
* @param $name
* @param string $get_miss_key_callback
* @param int $ttl
* @return array|bool
*/ */
public function get($name, $get_miss_key_callback = '', $ttl = 604800) public function get($name, $get_miss_key_callback = '', $ttl = 604800)
{ {
@ -44,6 +48,10 @@ class cache_common
/** /**
* Store value of variable * Store value of variable
* @param $name
* @param $value
* @param int $ttl
* @return bool
*/ */
public function set($name, $value, $ttl = 604800): bool public function set($name, $value, $ttl = 604800): bool
{ {
@ -52,6 +60,8 @@ class cache_common
/** /**
* Remove variable * Remove variable
* @param string $name
* @return bool
*/ */
public function rm($name = ''): bool public function rm($name = ''): bool
{ {

View file

@ -151,6 +151,8 @@ class ads_common
/** /**
* Get ads to show for each block * Get ads to show for each block
* @param $block_types
* @return array
*/ */
public function get($block_types): array public function get($block_types): array
{ {
@ -187,6 +189,8 @@ class ads_common
/** /**
* Get block_ids for specified block_types * Get block_ids for specified block_types
* @param $block_types
* @return array
*/ */
public function get_block_ids($block_types): array public function get_block_ids($block_types): array
{ {
@ -203,6 +207,8 @@ class ads_common
/** /**
* Get ad_ids for specified blocks * Get ad_ids for specified blocks
* @param $block_ids
* @return array
*/ */
public function get_ad_ids($block_ids): array public function get_ad_ids($block_ids): array
{ {
@ -807,6 +813,8 @@ function replace_quote($str, $double = true, $single = true)
/** /**
* Build simple hidden fields from array * Build simple hidden fields from array
* @param $fields_ary
* @return string
*/ */
function build_hidden_fields($fields_ary) function build_hidden_fields($fields_ary)
{ {
@ -828,6 +836,10 @@ function build_hidden_fields($fields_ary)
/** /**
* Choost russian word declension based on numeric [from dklab.ru] * Choost russian word declension based on numeric [from dklab.ru]
* Example for $expressions: array("ответ", "ответа", "ответов") * Example for $expressions: array("ответ", "ответа", "ответов")
* @param $int
* @param $expressions
* @param string $format
* @return mixed|string
*/ */
function declension($int, $expressions, $format = '%1$s %2$s') function declension($int, $expressions, $format = '%1$s %2$s')
{ {
@ -882,6 +894,8 @@ function url_arg($url, $arg, $value, $amp = '&')
/** /**
* Adds commas between every group of thousands * Adds commas between every group of thousands
* @param $number
* @return string
*/ */
function commify($number) function commify($number)
{ {
@ -890,6 +904,11 @@ function commify($number)
/** /**
* Returns a size formatted in a more human-friendly format, rounded to the nearest GB, MB, KB.. * Returns a size formatted in a more human-friendly format, rounded to the nearest GB, MB, KB..
* @param $size
* @param null $rounder
* @param null $min
* @param string $space
* @return string
*/ */
function humn_size($size, $rounder = null, $min = null, $space = ' ') function humn_size($size, $rounder = null, $min = null, $space = ' ')
{ {
@ -984,6 +1003,11 @@ function select_get_val($key, &$val, $options_ary, $default, $num = true)
* Set variable, used by {@link request_var the request_var function} * Set variable, used by {@link request_var the request_var function}
* *
* @access private * @access private
* @param $result
* @param $var
* @param $type
* @param bool $multibyte
* @param bool $strip
*/ */
function set_var(&$result, $var, $type, $multibyte = false, $strip = true) function set_var(&$result, $var, $type, $multibyte = false, $strip = true)
{ {
@ -1010,6 +1034,11 @@ function set_var(&$result, $var, $type, $multibyte = false, $strip = true)
* request_var * request_var
* *
* Used to get passed variable * Used to get passed variable
* @param $var_name
* @param $default
* @param bool $multibyte
* @param bool $cookie
* @return array
*/ */
function request_var($var_name, $default, $multibyte = false, $cookie = false) function request_var($var_name, $default, $multibyte = false, $cookie = false)
{ {
@ -2150,6 +2179,9 @@ function print_confirmation($tpl_vars)
* *
* $mode = 'no_header' * $mode = 'no_header'
* 'no_footer' * 'no_footer'
* @param $args
* @param string $type
* @param string $mode
*/ */
function print_page($args, $type = '', $mode = '') function print_page($args, $type = '', $mode = '')
{ {

View file

@ -21,6 +21,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
* @param $jobs
*/ */
function run_jobs($jobs) function run_jobs($jobs)

View file

@ -102,6 +102,8 @@ class user_common
/** /**
* Start session (restore existent session or create new) * Start session (restore existent session or create new)
* @param array $cfg
* @return array|bool|null
*/ */
public function session_start($cfg = array()) public function session_start($cfg = array())
{ {
@ -219,6 +221,9 @@ class user_common
/** /**
* Create new session for the given user * Create new session for the given user
* @param $userdata
* @param bool $auto_created
* @return array
*/ */
public function session_create($userdata, $auto_created = false): array public function session_create($userdata, $auto_created = false): array
{ {
@ -325,6 +330,8 @@ class user_common
/** /**
* Initialize sessiondata stored in cookies * Initialize sessiondata stored in cookies
* @param bool $update_lastvisit
* @param bool $set_cookie
*/ */
public function session_end($update_lastvisit = false, $set_cookie = true) public function session_end($update_lastvisit = false, $set_cookie = true)
{ {
@ -363,6 +370,9 @@ class user_common
/** /**
* Login * Login
* @param $args
* @param bool $mod_admin_login
* @return array
*/ */
public function login($args, $mod_admin_login = false): array public function login($args, $mod_admin_login = false): array
{ {
@ -443,6 +453,7 @@ class user_common
/** /**
* Store sessiondata in cookies * Store sessiondata in cookies
* @param $user_id
*/ */
public function set_session_cookies($user_id) public function set_session_cookies($user_id)
{ {
@ -478,6 +489,10 @@ class user_common
/** /**
* Verify autologin_id * Verify autologin_id
* @param $userdata
* @param bool $expire_check
* @param bool $create_new
* @return bool|string
*/ */
public function verify_autologin_id($userdata, $expire_check = false, $create_new = true) public function verify_autologin_id($userdata, $expire_check = false, $create_new = true)
{ {
@ -502,6 +517,9 @@ class user_common
/** /**
* Create autologin_id * Create autologin_id
* @param $userdata
* @param bool $create_new
* @return bool|string
*/ */
public function create_autologin_id($userdata, $create_new = true) public function create_autologin_id($userdata, $create_new = true)
{ {
@ -582,6 +600,7 @@ class user_common
/** /**
* Mark read * Mark read
* @param $type
*/ */
public function mark_read($type) public function mark_read($type)
{ {
@ -629,6 +648,8 @@ class user_common
/** /**
* Get not auth forums * Get not auth forums
* @param $auth_type
* @return string
*/ */
public function get_not_auth_forums($auth_type): string public function get_not_auth_forums($auth_type): string
{ {
@ -684,6 +705,9 @@ class user_common
/** /**
* Get excluded forums * Get excluded forums
* @param $auth_type
* @param string $return_as
* @return array|bool|string
*/ */
public function get_excluded_forums($auth_type, $return_as = 'csv') public function get_excluded_forums($auth_type, $return_as = 'csv')
{ {

View file

@ -135,6 +135,7 @@ class template
/** /**
* Constructor. Installs XS mod on first run or updates it and sets the root dir. * Constructor. Installs XS mod on first run or updates it and sets the root dir.
* @param string $root
*/ */
public function __construct($root = '.') public function __construct($root = '.')
{ {
@ -165,6 +166,9 @@ class template
* Generates a full path+filename for the given filename, which can either * Generates a full path+filename for the given filename, which can either
* be an absolute name, or a name relative to the rootdir for this Template * be an absolute name, or a name relative to the rootdir for this Template
* object. * object.
* @param $filename
* @param bool $xs_include
* @return mixed|string
*/ */
public function make_filename($filename, $xs_include = false) public function make_filename($filename, $xs_include = false)
{ {
@ -184,6 +188,8 @@ class template
* Converts template filename to cache filename. * Converts template filename to cache filename.
* Returns empty string if non-cachable (for tpl files outside of root dir). * Returns empty string if non-cachable (for tpl files outside of root dir).
* $filename should be absolute filename * $filename should be absolute filename
* @param $filename
* @return string
*/ */
public function make_filename_cache($filename): string public function make_filename_cache($filename): string
{ {
@ -195,6 +201,7 @@ class template
/** /**
* Sets the template filenames for handles. $filename_array * Sets the template filenames for handles. $filename_array
* should be a hash of handle => filename pairs. * should be a hash of handle => filename pairs.
* @param $filenames
*/ */
public function set_filenames($filenames) public function set_filenames($filenames)
{ {
@ -205,6 +212,11 @@ class template
/** /**
* Assigns template filename for handle. * Assigns template filename for handle.
* @param $handle
* @param $filename
* @param bool $xs_include
* @param bool $quiet
* @return bool
*/ */
public function set_filename($handle, $filename, $xs_include = false, $quiet = false): bool public function set_filename($handle, $filename, $xs_include = false, $quiet = false): bool
{ {
@ -247,6 +259,9 @@ class template
/** /**
* includes file or executes code * includes file or executes code
* @param $filename
* @param $code
* @param $handle
*/ */
public function execute($filename, $code, $handle) public function execute($filename, $code, $handle)
{ {
@ -268,6 +283,8 @@ class template
* Load the file for the handle, compile the file, * Load the file for the handle, compile the file,
* and run the compiled code. This will print out * and run the compiled code. This will print out
* the results of executing the template. * the results of executing the template.
* @param $handle
* @return bool
*/ */
public function pparse($handle): bool public function pparse($handle): bool
{ {
@ -321,6 +338,9 @@ class template
/** /**
* Precompile file * Precompile file
* @param $template
* @param $filename
* @return bool
*/ */
public function precompile($template, $filename): bool public function precompile($template, $filename): bool
{ {
@ -376,6 +396,9 @@ class template
* template. * template.
* Note that all desired assignments to the variables in $handle should be done * Note that all desired assignments to the variables in $handle should be done
* BEFORE calling this function. * BEFORE calling this function.
* @param $varname
* @param $handle
* @return bool
*/ */
public function assign_var_from_handle($varname, $handle): bool public function assign_var_from_handle($varname, $handle): bool
{ {
@ -390,6 +413,9 @@ class template
* Block-level variable assignment. Adds a new block iteration with the given * Block-level variable assignment. Adds a new block iteration with the given
* variable assignments. Note that this should only be called once per block * variable assignments. Note that this should only be called once per block
* iteration. * iteration.
* @param $blockname
* @param $vararray
* @return bool
*/ */
public function assign_block_vars($blockname, $vararray): bool public function assign_block_vars($blockname, $vararray): bool
{ {
@ -420,6 +446,7 @@ class template
/** /**
* Root-level variable assignment. Adds to current assignments, overriding * Root-level variable assignment. Adds to current assignments, overriding
* any existing variable assignment with the same name. * any existing variable assignment with the same name.
* @param $vararray
*/ */
public function assign_vars($vararray) public function assign_vars($vararray)
{ {
@ -431,6 +458,8 @@ class template
/** /**
* Root-level variable assignment. Adds to current assignments, overriding * Root-level variable assignment. Adds to current assignments, overriding
* any existing variable assignment with the same name. * any existing variable assignment with the same name.
* @param $varname
* @param bool $varval
*/ */
public function assign_var($varname, $varval = true) public function assign_var($varname, $varval = true)
{ {
@ -441,6 +470,7 @@ class template
* TODO: Add type check [??] * TODO: Add type check [??]
* Root-level. Adds to current assignments, appends * Root-level. Adds to current assignments, appends
* to any existing variable assignment with the same name. * to any existing variable assignment with the same name.
* @param $vararray
*/ */
public function append_vars($vararray) public function append_vars($vararray)
{ {
@ -452,6 +482,8 @@ class template
/** /**
* If not already done, load the file for the given handle and populate * If not already done, load the file for the given handle and populate
* the uncompiled_code[] hash with its code. Do not compile. * the uncompiled_code[] hash with its code. Do not compile.
* @param $handle
* @return bool
*/ */
public function loadfile($handle): bool public function loadfile($handle): bool
{ {
@ -487,6 +519,9 @@ class template
* ' . $this->_tpldata['parent.'][$_parent_i]['$child1.'][$_child1_i]['$child2.'][$_child2_i]...['varname'] . ' * ' . $this->_tpldata['parent.'][$_parent_i]['$child1.'][$_child1_i]['$child2.'][$_child2_i]...['varname'] . '
* It's ready to be inserted into an "echo" line in one of the templates. * It's ready to be inserted into an "echo" line in one of the templates.
* NOTE: expects a trailing "." on the namespace. * NOTE: expects a trailing "." on the namespace.
* @param $namespace
* @param $varname
* @return string
*/ */
public function generate_block_varref($namespace, $varname): string public function generate_block_varref($namespace, $varname): string
{ {
@ -512,6 +547,9 @@ class template
* *
* If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
* NOTE: does not expect a trailing "." on the blockname. * NOTE: does not expect a trailing "." on the blockname.
* @param $blockname
* @param $include_last_iterator
* @return string
*/ */
public function generate_block_data_ref($blockname, $include_last_iterator) public function generate_block_data_ref($blockname, $include_last_iterator)
{ {
@ -1013,6 +1051,10 @@ class template
/** /**
* Compiles code and writes to cache if needed * Compiles code and writes to cache if needed
* @param $code
* @param $handle
* @param $cache_file
* @return string
*/ */
public function compile2($code, $handle, $cache_file): string public function compile2($code, $handle, $cache_file): string
{ {
@ -1034,6 +1076,10 @@ class template
* executable, but can be used as part of a variable assignment * executable, but can be used as part of a variable assignment
* for use in assign_code_from_handle(). * for use in assign_code_from_handle().
* This function isn't used and kept only for compatibility with original template.php * This function isn't used and kept only for compatibility with original template.php
* @param $code
* @param bool $do_not_echo
* @param string $retvar
* @return string
*/ */
public function compile($code, $do_not_echo = false, $retvar = ''): string public function compile($code, $do_not_echo = false, $retvar = ''): string
{ {
@ -1046,6 +1092,8 @@ class template
/** /**
* Write cache to disk * Write cache to disk
* @param $filename
* @param $code
*/ */
public function write_cache($filename, $code) public function write_cache($filename, $code)
{ {