From 2348f9c4dd37460fc4ab562d78b133d3faa24665 Mon Sep 17 00:00:00 2001 From: Scott Date: Fri, 31 Jul 2020 20:32:59 +0100 Subject: [PATCH] Coding style --- qa-src/Controllers/Admin/Categories.php | 20 +++++++++----------- qa-src/Controllers/Admin/Points.php | 2 +- qa-src/Exceptions/ExceptionHandler.php | 2 +- qa-src/Notifications/Email.php | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/qa-src/Controllers/Admin/Categories.php b/qa-src/Controllers/Admin/Categories.php index 2ab26a118..b6ba07b56 100644 --- a/qa-src/Controllers/Admin/Categories.php +++ b/qa-src/Controllers/Admin/Categories.php @@ -430,14 +430,14 @@ public function index() ); } + $qcountHtml = $editcategory['qcount'] == 1 + ? qa_lang_html_sub('main/1_question', '1', '1') + : qa_lang_html_sub('main/x_questions', qa_format_number($editcategory['qcount'])); + $qa_content['form']['fields']['questions'] = array( 'label' => qa_lang_html('admin/total_qs'), 'type' => 'static', - 'value' => '' . - ($editcategory['qcount'] == 1 - ? qa_lang_html_sub('main/1_question', '1', '1') - : qa_lang_html_sub('main/x_questions', qa_format_number($editcategory['qcount'])) - ) . '', + 'value' => '' . $qcountHtml . '', ); if ($hassubcategory && !qa_opt('allow_no_sub_category')) { @@ -601,14 +601,12 @@ public function index() foreach ($categories as $category) { if (!isset($category['parentid'])) { + $qcountHtml = $category['qcount'] == 1 + ? qa_lang_html_sub('main/1_question', '1', '1') + : qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'])); $navcategoryhtml .= '' . - qa_html($category['title']) . - ' - ' . - ($category['qcount'] == 1 - ? qa_lang_html_sub('main/1_question', '1', '1') - : qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'])) - ) . '
'; + qa_html($category['title']) . ' - ' . $qcountHtml . '
'; } } diff --git a/qa-src/Controllers/Admin/Points.php b/qa-src/Controllers/Admin/Points.php index a16e2e9ef..8ffc7a339 100644 --- a/qa-src/Controllers/Admin/Points.php +++ b/qa-src/Controllers/Admin/Points.php @@ -18,8 +18,8 @@ namespace Q2A\Controllers\Admin; -use Q2A\Database\DbConnection; use Q2A\Controllers\BaseController; +use Q2A\Database\DbConnection; use Q2A\Middleware\Auth\MinimumUserLevel; /** diff --git a/qa-src/Exceptions/ExceptionHandler.php b/qa-src/Exceptions/ExceptionHandler.php index feb4d77d3..ba5981cd8 100644 --- a/qa-src/Exceptions/ExceptionHandler.php +++ b/qa-src/Exceptions/ExceptionHandler.php @@ -19,8 +19,8 @@ namespace Q2A\Exceptions; use Exception; -use Q2A\Http\Exceptions\PageNotFoundException; use Q2A\Http\Exceptions\MethodNotAllowedException; +use Q2A\Http\Exceptions\PageNotFoundException; class ExceptionHandler { diff --git a/qa-src/Notifications/Email.php b/qa-src/Notifications/Email.php index f221947b0..8db16c7fa 100644 --- a/qa-src/Notifications/Email.php +++ b/qa-src/Notifications/Email.php @@ -20,9 +20,9 @@ namespace Q2A\Notifications; +use PHPMailer; use Q2A\Exceptions\FatalErrorException; use Q2A\Notifications\Mailer; -use PHPMailer; class Email {