diff --git a/qa-include/pages/categories.php b/qa-include/pages/categories.php index 5caa51166..858c3fef9 100644 --- a/qa-include/pages/categories.php +++ b/qa-include/pages/categories.php @@ -66,7 +66,7 @@ function qa_category_nav_to_browse(&$navigation, $categories, $categoryid, $favo } $navigation[$key]['note'] = - ' - '.( ($category['qcount']==1) + ' - '.( ($category['qcount'] == 1) ? qa_lang_html_sub('main/1_question', '1', '1') : qa_lang_html_sub('main/x_questions', number_format($category['qcount'])) ).''; diff --git a/qa-include/plugins/qa-widget-ask-box.php b/qa-include/plugins/qa-widget-ask-box.php index 8b03e65f1..94d69214f 100644 --- a/qa-include/plugins/qa-widget-ask-box.php +++ b/qa-include/plugins/qa-widget-ask-box.php @@ -47,10 +47,10 @@ public function output_widget($region, $place, $themeobject, $template, $request
- - + diff --git a/qa-plugin/tag-cloud-widget/qa-tag-cloud-lang-default.php b/qa-plugin/tag-cloud-widget/qa-tag-cloud-lang-default.php index fc4260bba..231f024b8 100644 --- a/qa-plugin/tag-cloud-widget/qa-tag-cloud-lang-default.php +++ b/qa-plugin/tag-cloud-widget/qa-tag-cloud-lang-default.php @@ -23,7 +23,7 @@ 'biggest_font_size' => 'Biggest font size:', 'font_size_popularity' => 'Font size represents tag popularity', 'max_tags' => 'Maximum tags to show:', - 'pixels'=> 'pixels', + 'pixels' => 'pixels', 'smallest_font_size' => 'Smallest allowed font size:', 'tags' => 'tags', ); diff --git a/qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php b/qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php index de1c1f9f3..b1a87f029 100644 --- a/qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php +++ b/qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php @@ -48,7 +48,7 @@ public function admin_form(&$qa_content) if (qa_clicked('wysiwyg_editor_save_button')) { qa_opt('wysiwyg_editor_upload_images', (int)qa_post_text('wysiwyg_editor_upload_images_field')); qa_opt('wysiwyg_editor_upload_all', (int)qa_post_text('wysiwyg_editor_upload_all_field')); - qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576*(float)qa_post_text('wysiwyg_editor_upload_max_size_field'))); + qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576 * (float)qa_post_text('wysiwyg_editor_upload_max_size_field'))); $saved = true; } diff --git a/qa-src/Controllers/Admin/Categories.php b/qa-src/Controllers/Admin/Categories.php index 455752972..2ab26a118 100644 --- a/qa-src/Controllers/Admin/Categories.php +++ b/qa-src/Controllers/Admin/Categories.php @@ -224,9 +224,9 @@ public function index() qa_report_event('cat_edit', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array( 'categoryid' => $editcategory['categoryid'], - 'parentid' => isset($inparentid)?$inparentid:null, - 'content' => isset($incontent)?$incontent:null, - 'position' => isset($inposition)?$inposition:null, + 'parentid' => isset($inparentid) ? $inparentid : null, + 'content' => isset($incontent) ? $incontent : null, + 'position' => isset($inposition) ? $inposition : null, 'name' => $inname, 'slug' => $inslug, )); @@ -243,8 +243,8 @@ public function index() qa_report_event('cat_new', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array( 'categoryid' => $categoryid, 'parentid' => $inparentid, - 'content' => isset($incontent)?$incontent:null, - 'position' => isset($inposition)?$inposition:null, + 'content' => isset($incontent) ? $incontent : null, + 'position' => isset($inposition) ? $inposition : null, 'name' => $inname, 'slug' => $inslug, )); diff --git a/qa-src/Controllers/User/UserProfile.php b/qa-src/Controllers/User/UserProfile.php index 43f1725b3..1d0e643f4 100644 --- a/qa-src/Controllers/User/UserProfile.php +++ b/qa-src/Controllers/User/UserProfile.php @@ -506,7 +506,7 @@ public function profile($handle) foreach ($userlevels as $userlevel) { if ($userlevel['entitytype'] == QA_ENTITY_CATEGORY) { $index++; - $id = 'ls_' . +$index; + $id = 'ls_' . (+$index); $qa_content['form_profile']['fields']['uc_' . $index . '_level'] = array( 'label' => qa_lang_html('users/category_level_label'), diff --git a/qa-src/Util/Usage.php b/qa-src/Util/Usage.php index ec56e4cc2..e6ec1138d 100644 --- a/qa-src/Util/Usage.php +++ b/qa-src/Util/Usage.php @@ -35,7 +35,7 @@ class Usage public function __construct() { $this->stages = array(); - $this->databaseUsage = array('queries'=>0, 'clock'=>0); + $this->databaseUsage = array('queries' => 0, 'clock' => 0); $this->databaseQueryLog = ''; $this->prevUsage = $this->startUsage = $this->getCurrent(); @@ -99,7 +99,7 @@ public function logDatabaseQuery($query, $usedtime, $gotrows, $gotcolumns) $rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns'); } - $this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime*1000) . $rowcolstring . "\n\n"; + $this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime * 1000) . $rowcolstring . "\n\n"; } $this->databaseUsage['queries']++; @@ -210,7 +210,7 @@ private function delta($oldusage, $newusage) $delta = array(); foreach ($newusage as $key => $value) { - $delta[$key] = max(0, $value-@$oldusage[$key]); + $delta[$key] = max(0, $value - @$oldusage[$key]); } return $delta; diff --git a/qa-tests/phpcs/ruleset-strict.xml b/qa-tests/phpcs/ruleset-strict.xml index b248a5268..f30ae7c2c 100644 --- a/qa-tests/phpcs/ruleset-strict.xml +++ b/qa-tests/phpcs/ruleset-strict.xml @@ -32,6 +32,12 @@ + + + + + + 0 diff --git a/qa-theme/Snow/qa-theme.php b/qa-theme/Snow/qa-theme.php index 43f363777..f3c44d03a 100644 --- a/qa-theme/Snow/qa-theme.php +++ b/qa-theme/Snow/qa-theme.php @@ -51,9 +51,9 @@ public function logged_in() qa_html_theme_base::logged_in(); if (qa_is_logged_in()) { // adds points count after logged in username - $userpoints=qa_get_logged_in_points(); + $userpoints = qa_get_logged_in_points(); - $pointshtml=($userpoints==1) + $pointshtml = ($userpoints == 1) ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(qa_format_number($userpoints))); @@ -102,7 +102,7 @@ public function header() // removes sidebar for user profile pages public function sidepanel() { - if ($this->template!='user') + if ($this->template != 'user') qa_html_theme_base::sidepanel(); } @@ -140,7 +140,7 @@ public function q_item_stats($q_item) // prevent display of view count in the usual place public function view_count($q_item) { - if ($this->template=='question') + if ($this->template == 'question') qa_html_theme_base::view_count($q_item); }
+ ' '))?>: