Skip to content

Commit b0cb0de

Browse files
authored
Merge pull request #673 from pupi1985/patch-119
Fix many phpcs complaints
2 parents 0c4e5d4 + 2cae662 commit b0cb0de

8 files changed

Lines changed: 17 additions & 21 deletions

File tree

qa-config-example.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
/*
6767
If you wish, you can define QA_MYSQL_USERS_PREFIX separately from QA_MYSQL_TABLE_PREFIX.
6868
If so, tables containing information about user accounts (not including users' activity and points)
69-
get the prefix of QA_MYSQL_TABLE_PREFIX. This allows multiple Q2A sites to have shared logins
69+
get the prefix of QA_MYSQL_TABLE_PREFIX. This allows multiple Q2A sites to have shared logins
7070
and users, but separate posts and activity.
71-
72-
If you have installed question2answer with default "qa_" prefix and want to setup a second
73-
installation, you define the QA_MYSQL_USERS_PREFIX as "qa_" so this new installation
71+
72+
If you have installed question2answer with default "qa_" prefix and want to setup a second
73+
installation, you define the QA_MYSQL_USERS_PREFIX as "qa_" so this new installation
7474
can access the same database as the first installation.
75-
75+
7676
define('QA_MYSQL_USERS_PREFIX', 'sharedusers_');
7777
*/
7878

@@ -143,8 +143,8 @@
143143
/*
144144
Out-of-the-box Joomla! 3.x integration - to integrate with your Joomla! site, define
145145
QA_JOOMLA_INTEGRATE_PATH. as the full path to the Joomla! directory. If your Q2A
146-
site is a subdirectory of your main Joomla site (recommended), you can specify
147-
dirname(__DIR__) rather than the full path.
146+
site is a subdirectory of your main Joomla site (recommended), you can specify
147+
dirname(__DIR__) rather than the full path.
148148
With this set, you do not need to set the QA_MYSQL_* constants above since these
149149
will be taken from Joomla automatically. See online documentation for more details.
150150

qa-include/Q2A/Util/Usage.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function output()
109109
$totaldelta = $this->delta($this->startUsage, $this->getCurrent());
110110
$stages = $this->stages;
111111
$stages['total'] = $totaldelta;
112-
?>
112+
?>
113113
<style>
114114
.debug-table { border-collapse: collapse; width: auto; margin: 20px auto; }
115115
.debug-table th, .debug-table td { border: 1px solid #aaa; background-color: #ddd; padding: 5px 10px; }
@@ -155,7 +155,7 @@ public function output()
155155
</tr>
156156
</thead>
157157
<tbody>
158-
<?php foreach ($stages as $stage => $stagedelta) : ?>
158+
<?php foreach ($stages as $stage => $stagedelta) : ?>
159159
<tr>
160160
<td class="row-heading"><?php echo ucfirst($stage); ?></td>
161161
<td><?php echo sprintf('%.1f', $stagedelta['clock'] * 1000); ?></td>
@@ -171,7 +171,7 @@ public function output()
171171
<td><?php echo sprintf('%dk', $stagedelta['ram'] / 1024); ?></td>
172172
<td><?php echo sprintf('%d%%', $stagedelta['ram'] ? ($stagedelta['ram'] * 100 / $totaldelta['ram']) : 0); ?></td>
173173
</tr>
174-
<?php endforeach; ?>
174+
<?php endforeach; ?>
175175
</tbody>
176176
</table>
177177

@@ -190,7 +190,7 @@ public function output()
190190
</tr>
191191
</tbody>
192192
</table>
193-
<?php
193+
<?php
194194
}
195195

196196

qa-include/pages/admin/admin-userfields.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
}
101101

102102
} elseif (empty($errors)) { // creating a new user field
103-
104103
for ($attempt = 0; $attempt < 1000; $attempt++) {
105104
$suffix = $attempt ? ('-' . (1 + $attempt)) : '';
106105
$newtag = qa_substr(implode('-', qa_string_to_words($inname)), 0, QA_DB_MAX_PROFILE_TITLE_LENGTH - strlen($suffix)) . $suffix;

qa-include/pages/question-post.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ function qa_page_q_edit_a_submit($answer, $question, $answers, $commentsfollows,
809809
(($in['commenton'] != $answerid) && @$answers[$in['commenton']]['commentable'])
810810
)
811811
) { // convert to a comment
812-
813812
if (qa_user_limits_remaining(QA_LIMIT_COMMENTS)) { // already checked 'permit_post_c'
814813
qa_answer_to_comment($answer, $in['commenton'], $in['content'], $in['format'], $in['text'], $setnotify,
815814
$userid, $handle, $cookieid, $question, $answers, $commentsfollows, @$in['name'], $in['queued'], $in['silent']);

qa-include/pages/user-profile.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
($loginlevel >= QA_USER_LEVEL_SUPER || $loginlevel > $maxuserlevel) &&
9090
!qa_user_permit_error()
9191
) { // can't change self - or someone on your level (or higher, obviously) unless you're a super admin
92-
9392
if ($loginlevel >= QA_USER_LEVEL_SUPER)
9493
$maxlevelassign = QA_USER_LEVEL_SUPER;
9594
elseif ($loginlevel >= QA_USER_LEVEL_ADMIN)

qa-include/plugins/qa-widget-ask-box.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ public function output_widget($region, $place, $themeobject, $template, $request
4242
else
4343
$params = null;
4444

45-
?>
45+
?>
4646
<div class="qa-ask-box">
4747
<form method="post" action="<?php echo qa_path_html('ask', $params); ?>">
4848
<table class="qa-form-tall-table" style="width:100%">
4949
<tr style="vertical-align:middle;">
5050
<td class="qa-form-tall-label" style="width: 1px; padding:8px; white-space:nowrap; <?php echo ($region=='side') ? 'padding-bottom:0;' : 'text-align:right;'?>">
5151
<?php echo strtr(qa_lang_html('question/ask_title'), array(' ' => '&nbsp;'))?>:
5252
</td>
53-
<?php if ($region=='side') : ?>
53+
<?php if ($region=='side') : ?>
5454
</tr>
5555
<tr>
56-
<?php endif; ?>
56+
<?php endif; ?>
5757
<td class="qa-form-tall-data" style="padding:8px;">
5858
<input name="title" type="text" class="qa-form-tall-text" style="width:95%;">
5959
</td>
@@ -62,6 +62,6 @@ public function output_widget($region, $place, $themeobject, $template, $request
6262
<input type="hidden" name="doask1" value="1">
6363
</form>
6464
</div>
65-
<?php
65+
<?php
6666
}
6767
}

qa-plugin/facebook-login/qa-facebook-login.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function facebook_html($tourl, $logout, $context)
5757
else
5858
$size = 'medium';
5959

60-
?>
60+
?>
6161
<span id="fb-root" style="display:inline;"></span>
6262
<script>
6363
window.fbAsyncInit = function() {
@@ -82,7 +82,7 @@ public function facebook_html($tourl, $logout, $context)
8282
</script>
8383
<span class="fb-login-button" style="display:inline; vertical-align:middle;" size="<?php echo $size?>" <?php echo $logout ? 'autologoutlink="true"' : 'scope="email,user_about_me,user_location,user_website"'?>>
8484
</span>
85-
<?php
85+
<?php
8686
}
8787

8888

qa-plugin/mouseover-layer/qa-mouseover-layer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class qa_html_theme_layer extends qa_html_theme_base
2525
public function q_list($q_list)
2626
{
2727
if (!empty($q_list['qs']) && qa_opt('mouseover_content_on')) { // first check it is not an empty list and the feature is turned on
28-
2928
// Collect the question ids of all items in the question list (so we can do this in one DB query)
3029

3130
$postids = array();

0 commit comments

Comments
 (0)