From 5d6039d1c567d7a46c37e06382f4cfaffe6113da Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 5 May 2017 01:05:10 +0300 Subject: [PATCH] Parameter could be declared as array. (cherry picked from commit 07c6fd4) --- library/includes/functions.php | 8 ++++---- library/includes/functions_upload.php | 6 ++++-- library/includes/sessions.php | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/library/includes/functions.php b/library/includes/functions.php index 2e1914d6e..708941c8d 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -348,7 +348,7 @@ function setbit(&$int, $bit_num, $on) forum auth levels, this will prevent the auth function having to do its own lookup */ -function auth($type, $forum_id, $ug_data, $f_access = array(), $group_perm = UG_PERM_BOTH) +function auth($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH) { global $lang, $bf, $datastore; @@ -1973,7 +1973,7 @@ class log_action } } - public function mod($type_name, $args = array()) + public function mod($type_name, array $args = array()) { global $userdata; @@ -2021,7 +2021,7 @@ class log_action DB()->query("INSERT INTO " . BB_LOG . " $sql_args"); } - public function admin($type_name, $args = array()) + public function admin($type_name, array $args = array()) { $this->mod($type_name, $args); } @@ -2255,7 +2255,7 @@ function log_sphinx_error($err_type, $err_msg, $query = '') } } -function get_title_match_topics($title_match_sql, $forum_ids = array()) +function get_title_match_topics($title_match_sql, array $forum_ids = array()) { global $bb_cfg, $sphinx, $userdata, $title_match, $lang; diff --git a/library/includes/functions_upload.php b/library/includes/functions_upload.php index e15af4044..cebdaee8a 100644 --- a/library/includes/functions_upload.php +++ b/library/includes/functions_upload.php @@ -129,13 +129,15 @@ class upload_common return true; } - public function store($mode = '', $params = array()) + public function store($mode = '', array $params = array()) { if ($mode == 'avatar') { delete_avatar($params['user_id'], $params['avatar_ext_id']); $file_path = get_avatar_path($params['user_id'], $this->file_ext_id); return $this->_move($file_path); - } elseif ($mode == 'attach') { + } + + if ($mode == 'attach') { $file_path = get_attach_path($params['topic_id']); return $this->_move($file_path); } else { diff --git a/library/includes/sessions.php b/library/includes/sessions.php index 077bc1a5c..2815b7877 100644 --- a/library/includes/sessions.php +++ b/library/includes/sessions.php @@ -103,7 +103,7 @@ class user_common /** * Start session (restore existent session or create new) */ - public function session_start($cfg = array()) + public function session_start(array $cfg = array()) { global $bb_cfg;