Skip to content

Commit 20dd49c

Browse files
committed
PSR2 fixer
1 parent b688c7d commit 20dd49c

File tree

110 files changed

+1420
-1252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1420
-1252
lines changed

featherbb/Controller/Admin/Bans.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ public function display($req, $res, $args)
5151
'ban_data' => $ban_data['data'],
5252
]
5353
)->addTemplate('admin/bans/search_ban.php')->display();
54-
}
55-
else {
54+
} else {
5655
AdminUtils::generateAdminMenu('bans');
5756

5857
View::setPageInfo([

featherbb/Controller/Admin/Categories.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function edit($req, $res, $args)
6464
Container::get('cache')->store('quickjump', Cache::get_quickjump());
6565

6666
return Router::redirect(Router::pathFor('adminCategories'), __('Categories updated redirect'));
67-
6867
}
6968

7069
public function delete($req, $res, $args)

featherbb/Controller/Admin/Forums.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public function edit($req, $res, $args)
5050
{
5151
Container::get('hooks')->fire('controller.admin.forums.edit');
5252

53-
if(Request::isPost()) {
53+
if (Request::isPost()) {
5454
if (Input::post('save') && Input::post('read_forum_old')) {
5555

5656
// Forums parameters / TODO : better handling of wrong parameters
5757
$forum_data = ['forum_name' => Utils::escape(Input::post('forum_name')),
58-
'forum_desc' => Input::post('forum_desc') ? Utils::linebreaks(Utils::trim(Input::post('forum_desc'))) : NULL,
58+
'forum_desc' => Input::post('forum_desc') ? Utils::linebreaks(Utils::trim(Input::post('forum_desc'))) : null,
5959
'cat_id' => (int) Input::post('cat_id'),
6060
'sort_by' => (int) Input::post('sort_by'),
61-
'redirect_url' => Url::is_valid(Input::post('redirect_url')) ? Utils::escape(Input::post('redirect_url')) : NULL];
61+
'redirect_url' => Url::is_valid(Input::post('redirect_url')) ? Utils::escape(Input::post('redirect_url')) : null];
6262

6363
if ($forum_data['forum_name'] == '') {
6464
return Router::redirect(Router::pathFor('editForum', ['id' => $args['id']]), __('Must enter name message'));
@@ -71,13 +71,12 @@ public function edit($req, $res, $args)
7171

7272
// Permissions
7373
$permissions = $this->model->get_default_group_permissions(false);
74-
foreach($permissions as $perm_group) {
74+
foreach ($permissions as $perm_group) {
7575
$permissions_data = ['group_id' => $perm_group['g_id'],
7676
'forum_id' => $args['id']];
7777
if ($perm_group['board.read'] == '1' && isset(Input::post('read_forum_new')[$perm_group['g_id']]) && Input::post('read_forum_new')[$perm_group['g_id']] == '1') {
7878
$permissions_data['read_forum'] = '1';
79-
}
80-
else {
79+
} else {
8180
$permissions_data['read_forum'] = '0';
8281
}
8382

@@ -87,11 +86,11 @@ public function edit($req, $res, $args)
8786
if ($permissions_data['read_forum'] != Input::post('read_forum_old')[$perm_group['g_id']] ||
8887
$permissions_data['post_replies'] != Input::post('post_replies_old')[$perm_group['g_id']] ||
8988
$permissions_data['post_topics'] != Input::post('post_topics_old')[$perm_group['g_id']]) {
90-
// If there is no group permissions override for this forum
89+
// If there is no group permissions override for this forum
9190
if ($permissions_data['read_forum'] == '1' && $permissions_data['post_replies'] == $perm_group['topic.reply'] && $permissions_data['post_topics'] == $perm_group['topic.post']) {
9291
$this->model->delete_permissions($args['id'], $perm_group['g_id']);
9392
} else {
94-
// Run an UPDATE and see if it affected a row, if not, INSERT
93+
// Run an UPDATE and see if it affected a row, if not, INSERT
9594
$this->model->update_permissions($permissions_data);
9695
}
9796
}
@@ -101,7 +100,6 @@ public function edit($req, $res, $args)
101100
Container::get('cache')->store('quickjump', Cache::get_quickjump());
102101

103102
return Router::redirect(Router::pathFor('editForum', ['id' => $args['id']]), __('Forum updated redirect'));
104-
105103
} elseif (Input::post('revert_perms')) {
106104
$this->model->delete_permissions($args['id']);
107105

@@ -110,7 +108,6 @@ public function edit($req, $res, $args)
110108

111109
return Router::redirect(Router::pathFor('editForum', ['id' => $args['id']]), __('Perms reverted redirect'));
112110
}
113-
114111
} else {
115112
AdminUtils::generateAdminMenu('forums');
116113

@@ -136,13 +133,12 @@ public function delete($req, $res, $args)
136133
return $notFoundHandler($req, $res);
137134
}
138135

139-
if(Request::isPost()) {
136+
if (Request::isPost()) {
140137
$this->model->delete_forum($args['id']);
141138
// Regenerate the quick jump cache
142139
Container::get('cache')->store('quickjump', Cache::get_quickjump());
143140

144141
return Router::redirect(Router::pathFor('adminForums'), __('Forum deleted redirect'));
145-
146142
} else { // If the user hasn't confirmed
147143

148144
AdminUtils::generateAdminMenu('forums');

featherbb/Controller/Admin/Groups.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public function addedit($req, $res, $args)
107107

108108
// Add/edit a group (stage 1)
109109
elseif (Input::post('add_group') || isset($args['id'])) {
110-
111110
AdminUtils::generateAdminMenu('user groups');
112111

113112
$id = isset($args['id']) ? intval($args['id']) : intval(Input::post('base_group'));

featherbb/Controller/Admin/Plugins.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,11 @@ public function info($req, $res, $args)
119119
if (method_exists($plugin, 'info')) {
120120
AdminUtils::generateAdminMenu($args['name']);
121121
return $plugin->info($req, $res, $args);
122-
}
123-
else {
122+
} else {
124123
throw new Error(__('Bad request'), 400);
125124
}
126-
}
127-
else {
125+
} else {
128126
throw new Error(__('Bad request'), 400);
129127
}
130-
131128
}
132-
133129
}

featherbb/Controller/Admin/Users.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function display($req, $res, $args)
2828

2929
// Move multiple users to other user groups
3030
if (Input::post('move_users') || Input::post('move_users_comply')) {
31-
3231
AdminUtils::generateAdminMenu('users');
3332

3433
return View::setPageInfo([
@@ -43,7 +42,6 @@ public function display($req, $res, $args)
4342

4443
// Delete multiple users
4544
if (Input::post('delete_users') || Input::post('delete_users_comply')) {
46-
4745
AdminUtils::generateAdminMenu('users');
4846

4947
return View::setPageInfo([
@@ -111,8 +109,7 @@ public function display($req, $res, $args)
111109
'user_data' => $this->model->print_users($search['conditions'], $search['order_by'], $search['direction'], $start_from),
112110
]
113111
)->addTemplate('admin/users/find_users.php')->display();
114-
}
115-
else {
112+
} else {
116113
AdminUtils::generateAdminMenu('users');
117114

118115
return View::setPageInfo([

featherbb/Controller/Api/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
class Api
1313
{
1414
protected $errorMessage = ["error" => "Not Found"];
15-
}
15+
}

featherbb/Controller/Api/Forum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ public function display($req, $res, $args)
2222
{
2323
return json_encode($this->model->display($args['id']), JSON_PRETTY_PRINT);
2424
}
25-
}
25+
}

featherbb/Controller/Api/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ public function update($req, $res, $args)
8383

8484
return json_encode($errors, JSON_PRETTY_PRINT);
8585
}
86-
}
86+
}

featherbb/Controller/Api/Topic.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public function newTopic($req, $res, $args)
6767
$this->model->increment_post_count($post, $new['tid']);
6868

6969
return Router::redirect(Router::pathFor('postApi', ['id' => $new['pid']]));
70-
}
71-
else {
70+
} else {
7271
return json_encode($errors, JSON_PRETTY_PRINT);
7372
}
7473
}
@@ -124,9 +123,8 @@ public function newReply($req, $res, $args)
124123
$this->model->increment_post_count($post, $new['id']);
125124

126125
return Router::redirect(Router::pathFor('postApi', ['id' => $new['pid']]));
127-
}
128-
else {
126+
} else {
129127
return json_encode($errors, JSON_PRETTY_PRINT);
130128
}
131129
}
132-
}
130+
}

0 commit comments

Comments
 (0)