From fa841183424e1fca798a6b8dd2755814f5135840 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 7 Sep 2017 01:55:07 +0100 Subject: [PATCH] Coding style (misc) --- qa-include/app/page.php | 2 ++ qa-include/db/maxima.php | 2 +- qa-include/pages/tag.php | 3 ++- qa-include/pages/tags.php | 10 ++++++---- qa-include/pages/users-blocked.php | 3 ++- qa-include/pages/users-newest.php | 4 +++- qa-include/pages/users-special.php | 4 +++- qa-include/qa-base.php | 2 +- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/qa-include/app/page.php b/qa-include/app/page.php index 053071aaa..1beb19c21 100644 --- a/qa-include/app/page.php +++ b/qa-include/app/page.php @@ -813,6 +813,7 @@ function qa_content_prepare($voting = false, $categoryids = null) /** * Get the start parameter which should be used, as constrained by the setting in qa-config.php + * @return int */ function qa_get_start() { @@ -822,6 +823,7 @@ function qa_get_start() /** * Get the state parameter which should be used, as set earlier in qa_load_state() + * @return string */ function qa_get_state() { diff --git a/qa-include/db/maxima.php b/qa-include/db/maxima.php index d2ecddc2f..9d5a05951 100644 --- a/qa-include/db/maxima.php +++ b/qa-include/db/maxima.php @@ -63,7 +63,7 @@ 'QA_DB_MAX_EVENTS_PER_Q' => 5, ); -foreach ($maximaDefaults as $key=>$def) { +foreach ($maximaDefaults as $key => $def) { if (!defined($key)) { define($key, $def); } diff --git a/qa-include/pages/tag.php b/qa-include/pages/tag.php index df5b72738..575f0a346 100644 --- a/qa-include/pages/tag.php +++ b/qa-include/pages/tag.php @@ -35,8 +35,9 @@ // Find the questions with this tag -if (!strlen($tag)) +if (!strlen($tag)) { qa_redirect('tags'); +} list($questions, $tagword) = qa_db_select_with_pending( qa_db_tag_recent_qs_selectspec($userid, $tag, $start, false, qa_opt_if_loaded('page_size_tag_qs')), diff --git a/qa-include/pages/tags.php b/qa-include/pages/tags.php index 295d64de3..96215cefe 100644 --- a/qa-include/pages/tags.php +++ b/qa-include/pages/tags.php @@ -63,19 +63,21 @@ 'count' => qa_format_number($count, 0, true), ); - if ((++$output) >= $pagesize) + if ((++$output) >= $pagesize) { break; + } } - -} else +} else { $qa_content['title'] = qa_lang_html('main/no_tags_found'); +} $qa_content['canonical'] = qa_get_canonical(); $qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $tagcount, qa_opt('pages_prev_next')); -if (empty($qa_content['page_links'])) +if (empty($qa_content['page_links'])) { $qa_content['suggest_next'] = qa_html_suggest_ask(); +} return $qa_content; diff --git a/qa-include/pages/users-blocked.php b/qa-include/pages/users-blocked.php index 659af02e7..d1a047de2 100644 --- a/qa-include/pages/users-blocked.php +++ b/qa-include/pages/users-blocked.php @@ -31,8 +31,9 @@ // Check we're not using single-sign on integration -if (QA_FINAL_EXTERNAL_USERS) +if (QA_FINAL_EXTERNAL_USERS) { qa_fatal_error('User accounts are handled by external code'); +} // Get list of blocked users diff --git a/qa-include/pages/users-newest.php b/qa-include/pages/users-newest.php index f602cf2f8..5ea5deb1a 100644 --- a/qa-include/pages/users-newest.php +++ b/qa-include/pages/users-newest.php @@ -30,8 +30,9 @@ // Check we're not using single-sign on integration -if (QA_FINAL_EXTERNAL_USERS) +if (QA_FINAL_EXTERNAL_USERS) { qa_fatal_error('User accounts are handled by external code'); +} // Check we have permission to view this page (moderator or above) @@ -89,4 +90,5 @@ $qa_content['navigation']['sub'] = qa_users_sub_navigation(); + return $qa_content; diff --git a/qa-include/pages/users-special.php b/qa-include/pages/users-special.php index f17c3374a..7cdfbb717 100644 --- a/qa-include/pages/users-special.php +++ b/qa-include/pages/users-special.php @@ -31,8 +31,9 @@ // Check we're not using single-sign on integration -if (QA_FINAL_EXTERNAL_USERS) +if (QA_FINAL_EXTERNAL_USERS) { qa_fatal_error('User accounts are handled by external code'); +} // Get list of special users @@ -77,4 +78,5 @@ $qa_content['navigation']['sub'] = qa_users_sub_navigation(); + return $qa_content; diff --git a/qa-include/qa-base.php b/qa-include/qa-base.php index 0021f0cd3..6610d1622 100644 --- a/qa-include/qa-base.php +++ b/qa-include/qa-base.php @@ -253,7 +253,7 @@ function qa_initialize_constants_2() 'QA_DEBUG_PERFORMANCE' => false, ); - foreach ($defaults as $key=>$def) { + foreach ($defaults as $key => $def) { if (!defined($key)) { define($key, $def); }