Skip to content

Commit cd3bee1

Browse files
committed
Coding style
1 parent 4193905 commit cd3bee1

File tree

9 files changed

+24
-18
lines changed

9 files changed

+24
-18
lines changed

qa-include/pages/categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function qa_category_nav_to_browse(&$navigation, $categories, $categoryid, $favo
6666
}
6767

6868
$navigation[$key]['note'] =
69-
' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount']==1)
69+
' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount'] == 1)
7070
? qa_lang_html_sub('main/1_question', '1', '1')
7171
: qa_lang_html_sub('main/x_questions', number_format($category['qcount']))
7272
).'</a>';

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public function output_widget($region, $place, $themeobject, $template, $request
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;">
50-
<td class="qa-form-tall-label" style="width: 1px; padding:8px; white-space:nowrap; <?php echo ($region=='side') ? 'padding-bottom:0;' : 'text-align:right;'?>">
50+
<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>
5656
<?php endif; ?>

qa-plugin/tag-cloud-widget/qa-tag-cloud-lang-default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
'biggest_font_size' => 'Biggest font size:',
2424
'font_size_popularity' => 'Font size represents tag popularity',
2525
'max_tags' => 'Maximum tags to show:',
26-
'pixels'=> 'pixels',
26+
'pixels' => 'pixels',
2727
'smallest_font_size' => 'Smallest allowed font size:',
2828
'tags' => 'tags',
2929
);

qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function admin_form(&$qa_content)
4848
if (qa_clicked('wysiwyg_editor_save_button')) {
4949
qa_opt('wysiwyg_editor_upload_images', (int)qa_post_text('wysiwyg_editor_upload_images_field'));
5050
qa_opt('wysiwyg_editor_upload_all', (int)qa_post_text('wysiwyg_editor_upload_all_field'));
51-
qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576*(float)qa_post_text('wysiwyg_editor_upload_max_size_field')));
51+
qa_opt('wysiwyg_editor_upload_max_size', min(qa_get_max_upload_size(), 1048576 * (float)qa_post_text('wysiwyg_editor_upload_max_size_field')));
5252
$saved = true;
5353
}
5454

qa-src/Controllers/Admin/Categories.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ public function index()
224224

225225
qa_report_event('cat_edit', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array(
226226
'categoryid' => $editcategory['categoryid'],
227-
'parentid' => isset($inparentid)?$inparentid:null,
228-
'content' => isset($incontent)?$incontent:null,
229-
'position' => isset($inposition)?$inposition:null,
227+
'parentid' => isset($inparentid) ? $inparentid : null,
228+
'content' => isset($incontent) ? $incontent : null,
229+
'position' => isset($inposition) ? $inposition : null,
230230
'name' => $inname,
231231
'slug' => $inslug,
232232
));
@@ -243,8 +243,8 @@ public function index()
243243
qa_report_event('cat_new', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array(
244244
'categoryid' => $categoryid,
245245
'parentid' => $inparentid,
246-
'content' => isset($incontent)?$incontent:null,
247-
'position' => isset($inposition)?$inposition:null,
246+
'content' => isset($incontent) ? $incontent : null,
247+
'position' => isset($inposition) ? $inposition : null,
248248
'name' => $inname,
249249
'slug' => $inslug,
250250
));

qa-src/Controllers/User/UserProfile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ public function profile($handle)
506506
foreach ($userlevels as $userlevel) {
507507
if ($userlevel['entitytype'] == QA_ENTITY_CATEGORY) {
508508
$index++;
509-
$id = 'ls_' . +$index;
509+
$id = 'ls_' . (+$index);
510510

511511
$qa_content['form_profile']['fields']['uc_' . $index . '_level'] = array(
512512
'label' => qa_lang_html('users/category_level_label'),

qa-src/Util/Usage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Usage
3535
public function __construct()
3636
{
3737
$this->stages = array();
38-
$this->databaseUsage = array('queries'=>0, 'clock'=>0);
38+
$this->databaseUsage = array('queries' => 0, 'clock' => 0);
3939
$this->databaseQueryLog = '';
4040

4141
$this->prevUsage = $this->startUsage = $this->getCurrent();
@@ -99,7 +99,7 @@ public function logDatabaseQuery($query, $usedtime, $gotrows, $gotcolumns)
9999
$rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns');
100100
}
101101

102-
$this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime*1000) . $rowcolstring . "\n\n";
102+
$this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime * 1000) . $rowcolstring . "\n\n";
103103
}
104104

105105
$this->databaseUsage['queries']++;
@@ -210,7 +210,7 @@ private function delta($oldusage, $newusage)
210210
$delta = array();
211211

212212
foreach ($newusage as $key => $value) {
213-
$delta[$key] = max(0, $value-@$oldusage[$key]);
213+
$delta[$key] = max(0, $value - @$oldusage[$key]);
214214
}
215215

216216
return $delta;

qa-tests/phpcs/ruleset-strict.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
</properties>
3333
</rule>
3434

35+
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
36+
<properties>
37+
<property name="ignoreNewlines" value="true"/>
38+
</properties>
39+
</rule>
40+
3541
<!-- Not part of normal usage, but kept for testing (default severity = 5) -->
3642
<rule ref="Squiz.Commenting.FunctionComment">
3743
<severity>0</severity>

qa-theme/Snow/qa-theme.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function logged_in()
5151
qa_html_theme_base::logged_in();
5252

5353
if (qa_is_logged_in()) { // adds points count after logged in username
54-
$userpoints=qa_get_logged_in_points();
54+
$userpoints = qa_get_logged_in_points();
5555

56-
$pointshtml=($userpoints==1)
56+
$pointshtml = ($userpoints == 1)
5757
? qa_lang_html_sub('main/1_point', '1', '1')
5858
: qa_lang_html_sub('main/x_points', qa_html(qa_format_number($userpoints)));
5959

@@ -102,7 +102,7 @@ public function header()
102102
// removes sidebar for user profile pages
103103
public function sidepanel()
104104
{
105-
if ($this->template!='user')
105+
if ($this->template != 'user')
106106
qa_html_theme_base::sidepanel();
107107
}
108108

@@ -140,7 +140,7 @@ public function q_item_stats($q_item)
140140
// prevent display of view count in the usual place
141141
public function view_count($q_item)
142142
{
143-
if ($this->template=='question')
143+
if ($this->template == 'question')
144144
qa_html_theme_base::view_count($q_item);
145145
}
146146

0 commit comments

Comments
 (0)