Completed
Pull Request — master (#26)
by Daniel
12:54 queued 10:01
created
exception/base.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,10 +80,10 @@
 block discarded – undo
80 80
 		foreach ($message_portions as &$message)
81 81
 		{
82 82
 			// Attempt to translate each portion
83
-			$translated_message = $translator->lang('EXCEPTION_' . $message);
83
+			$translated_message = $translator->lang('EXCEPTION_'.$message);
84 84
 
85 85
 			// Check if translating did anything
86
-			if ($translated_message !== 'EXCEPTION_' . $message)
86
+			if ($translated_message !== 'EXCEPTION_'.$message)
87 87
 			{
88 88
 				// It did, so replace message with the translated version
89 89
 				$message = $translated_message;
Please login to merge, or discard this patch.
blocks/custom.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$content = $this->request->variable('content', '', true);
70 70
 		$cblocks = $this->get_custom_blocks();
71 71
 
72
-		$sql_data =	$this->get_default_fields($block_id);
72
+		$sql_data = $this->get_default_fields($block_id);
73 73
 		$sql_data['block_content'] = $content;
74 74
 
75 75
 		generate_text_for_storage($sql_data['block_content'], $sql_data['bbcode_uid'], $sql_data['bbcode_bitfield'], $sql_data['bbcode_options'], true, true, true);
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 	{
131 131
 		if (!$block_exists)
132 132
 		{
133
-			$sql = 'INSERT INTO ' . $this->cblocks_table . ' ' . $this->db->sql_build_array('INSERT', $sql_data);
133
+			$sql = 'INSERT INTO '.$this->cblocks_table.' '.$this->db->sql_build_array('INSERT', $sql_data);
134 134
 		}
135 135
 		else
136 136
 		{
137
-			$sql = 'UPDATE ' . $this->cblocks_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_data) . ' WHERE block_id = ' . (int) $sql_data['block_id'];
137
+			$sql = 'UPDATE '.$this->cblocks_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_data).' WHERE block_id = '.(int) $sql_data['block_id'];
138 138
 		}
139 139
 		$this->db->sql_query($sql);
140 140
 		$this->cache->destroy('pt_cblocks');
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 		if ($edit_mode !== false)
152 152
 		{
153 153
 			decode_message($cblock['block_content'], $cblock['bbcode_uid']);
154
-			$content = '<div id="block-editor-' . $cblock['block_id'] . '" class="editable editable-block" data-service="blitze.sitemaker.block.custom" data-method="edit" data-raw="' . $cblock['block_content'] . '">' . $content . '</div>';
154
+			$content = '<div id="block-editor-'.$cblock['block_id'].'" class="editable editable-block" data-service="blitze.sitemaker.block.custom" data-method="edit" data-raw="'.$cblock['block_content'].'">'.$content.'</div>';
155 155
 		}
156 156
 	}
157 157
 
Please login to merge, or discard this patch.
blocks/whats_new.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
 		if (!empty($collection))
51 51
 		{
52 52
 			return $collection->get_entities();
53
-		}
54
-		else
53
+		} else
55 54
 		{
56 55
 			return array();
57 56
 		}
@@ -88,8 +87,7 @@  discard block
 block discarded – undo
88 87
 		if (!$has_blocks && !$hiding_blocks && !sizeof($ex_positions))
89 88
 		{
90 89
 			$this->route_mapper->delete($route);
91
-		}
92
-		else
90
+		} else
93 91
 		{
94 92
 			$route->set_has_blocks($has_blocks);
95 93
 			$this->route_mapper->save($route);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 			$this->ptemplate->assign_block_vars('topicrow', array(
101 101
 				'TOPIC_TITLE'    => censor_text($row['topic_title']),
102
-				'U_VIEWTOPIC'    => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&amp;t=$topic_id"),
102
+				'U_VIEWTOPIC'    => append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&amp;t=$topic_id"),
103 103
 			));
104 104
 			unset($topic_data[$i]);
105 105
 		}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		return array(
142 142
 			'WHERE'		=> array(
143
-				't.topic_last_post_time > ' . $this->user->data['user_lastvisit'],
143
+				't.topic_last_post_time > '.$this->user->data['user_lastvisit'],
144 144
 				't.topic_moved_id = 0',
145 145
 			),
146 146
 		);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 				POSTS_TABLE		=> 'p',
157 157
 			),
158 158
 			'WHERE'		=> array(
159
-				't.topic_id = p.topic_id AND p.post_time > ' . $this->user->data['user_lastvisit'],
159
+				't.topic_id = p.topic_id AND p.post_time > '.$this->user->data['user_lastvisit'],
160 160
 			),
161 161
 		);
162 162
 	}
Please login to merge, or discard this patch.
blocks/whois.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		if (!empty($data['.'][0]['TOTAL_USERS_ONLINE']))
70 70
 		{
71
-			$l_online_users	= $data['.'][0]['TOTAL_USERS_ONLINE'];
71
+			$l_online_users = $data['.'][0]['TOTAL_USERS_ONLINE'];
72 72
 			$online_userlist = $data['.'][0]['LOGGED_IN_USER_LIST'];
73 73
 			$l_online_record = $data['.'][0]['RECORD_USERS'];
74 74
 		}
@@ -105,6 +105,6 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	private function get_viewonline_url()
107 107
 	{
108
-		return ($this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$this->phpbb_root_path}viewonline." . $this->php_ext) : '';
108
+		return ($this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$this->phpbb_root_path}viewonline.".$this->php_ext) : '';
109 109
 	}
110 110
 }
Please login to merge, or discard this patch.
model/menus/mapper/items.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -172,6 +172,6 @@
 block discarded – undo
172 172
 	 */
173 173
 	protected function get_sql_where($menu_id)
174 174
 	{
175
-		return '%smenu_id = ' . (int) $menu_id;
175
+		return '%smenu_id = '.(int) $menu_id;
176 176
 	}
177 177
 }
Please login to merge, or discard this patch.
services/tree/builder.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function get_item_info($item_id = 0)
57 57
 	{
58
-		$sql = 'SELECT * FROM ' . $this->table_name . ' ' . $this->get_sql_where('WHERE') .
59
-			(($item_id) ? " AND {$this->column_item_id} = " . (int) $item_id : '');
58
+		$sql = 'SELECT * FROM '.$this->table_name.' '.$this->get_sql_where('WHERE').
59
+			(($item_id) ? " AND {$this->column_item_id} = ".(int) $item_id : '');
60 60
 
61 61
 		$result = $this->db->sql_query($sql);
62 62
 		$row = $this->db->sql_fetchrow($result);
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	public function update_item($item_id, array $sql_data)
76 76
 	{
77 77
 		$sql = "UPDATE {$this->table_name}
78
-			SET " . $this->db->sql_build_array('UPDATE', $sql_data) . "
79
-			WHERE $this->column_item_id = " . (int) $item_id;
78
+			SET ".$this->db->sql_build_array('UPDATE', $sql_data)."
79
+			WHERE $this->column_item_id = ".(int) $item_id;
80 80
 		$this->db->sql_query($sql);
81 81
 
82 82
 		return $sql_data;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 		// Rather than updating each item individually, we will just delete all items
111 111
 		// then add them all over again with new parent_id|left_id|right_id
112
-		$this->db->sql_query("DELETE FROM {$this->table_name} " . $this->get_sql_where('WHERE'));
112
+		$this->db->sql_query("DELETE FROM {$this->table_name} ".$this->get_sql_where('WHERE'));
113 113
 
114 114
 		// Now we add it back
115 115
 		$sql_data = $this->add_sub_tree($tree, 0);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 			if ($depth && !$parent_id)
160 160
 			{
161
-				throw new \RuntimeException($this->message_prefix . 'MALFORMED_TREE');
161
+				throw new \RuntimeException($this->message_prefix.'MALFORMED_TREE');
162 162
 			}
163 163
 
164 164
 			$key = $i + $max_id + 1;
@@ -230,23 +230,23 @@  discard block
 block discarded – undo
230 230
 		foreach ($branch as $i => $row)
231 231
 		{
232 232
 			$left_id	= $right_id + 1;
233
-			$right_id   = $right_id + 2;
233
+			$right_id = $right_id + 2;
234 234
 
235 235
 			$sql_data[$i] = $row;
236
-			$sql_data[$i]['parent_id']	= $parent_id;
237
-			$sql_data[$i]['left_id']	= $left_id;
238
-			$sql_data[$i]['right_id']	= $right_id;
239
-			$sql_data[$i]['depth']		= $depth;
236
+			$sql_data[$i]['parent_id'] = $parent_id;
237
+			$sql_data[$i]['left_id'] = $left_id;
238
+			$sql_data[$i]['right_id'] = $right_id;
239
+			$sql_data[$i]['depth'] = $depth;
240 240
 
241 241
 			if ($row['parent_id'])
242 242
 			{
243
-				$left_id	= $sql_data[$row['parent_id']]['right_id'];
244
-				$right_id   = $left_id + 1;
243
+				$left_id = $sql_data[$row['parent_id']]['right_id'];
244
+				$right_id = $left_id + 1;
245 245
 
246
-				$sql_data[$i]['parent_id']	= $row['parent_id'];
247
-				$sql_data[$i]['depth']		= $sql_data[$row['parent_id']]['depth'] + 1;
248
-				$sql_data[$i]['left_id']	= $left_id;
249
-				$sql_data[$i]['right_id']	= $right_id;
246
+				$sql_data[$i]['parent_id'] = $row['parent_id'];
247
+				$sql_data[$i]['depth'] = $sql_data[$row['parent_id']]['depth'] + 1;
248
+				$sql_data[$i]['left_id'] = $left_id;
249
+				$sql_data[$i]['right_id'] = $right_id;
250 250
 
251 251
 				$this->update_right_side($sql_data, $right_id, $row['parent_id'], $branch);
252 252
 			}
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 				$this->db->sql_transaction('rollback');
273 273
 				$this->lock->release();
274 274
 
275
-				throw new \RuntimeException($this->message_prefix . 'INVALID_PARENT');
275
+				throw new \RuntimeException($this->message_prefix.'INVALID_PARENT');
276 276
 			}
277 277
 
278 278
 			// adjust items in affected branch
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	protected function get_max_id($column, $use_sql_where = true)
301 301
 	{
302 302
 		$sql = "SELECT MAX($column) AS $column
303
-			FROM {$this->table_name} " .
303
+			FROM {$this->table_name} ".
304 304
 			(($use_sql_where) ? $this->get_sql_where('WHERE') : '');
305 305
 		$result = $this->db->sql_query($sql);
306 306
 		$max_id = $this->db->sql_fetchfield($column);
Please login to merge, or discard this patch.
blocks/forum_topics.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
 		if (!empty($collection))
51 51
 		{
52 52
 			return $collection->get_entities();
53
-		}
54
-		else
53
+		} else
55 54
 		{
56 55
 			return array();
57 56
 		}
@@ -88,8 +87,7 @@  discard block
 block discarded – undo
88 87
 		if (!$has_blocks && !$hiding_blocks && !sizeof($ex_positions))
89 88
 		{
90 89
 			$this->route_mapper->delete($route);
91
-		}
92
-		else
90
+		} else
93 91
 		{
94 92
 			$route->set_has_blocks($has_blocks);
95 93
 			$this->route_mapper->save($route);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	{
142 142
 		$this->set_display_fields();
143 143
 
144
-		$view = 'S_' . strtoupper($this->settings['template']);
144
+		$view = 'S_'.strtoupper($this->settings['template']);
145 145
 		$post_data = $this->get_post_data($topic_data);
146 146
 		$topic_data = array_values($topic_data);
147 147
 
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 				'VIEWS'				=> $row['topic_views'],
190 190
 				'S_UNREAD_TOPIC'	=> $this->is_unread_topic($forum_id, $topic_id, $row['topic_last_post_time']),
191 191
 
192
-				'U_VIEWTOPIC'		=> append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&amp;t=$topic_id"),
193
-				'U_VIEWFORUM'		=> append_sid($this->phpbb_root_path . 'viewforum.' . $this->php_ext, "f=$forum_id"),
194
-				'U_NEW_POST'		=> append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
195
-				'U_LAST_POST'		=> append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&amp;t=$topic_id&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
192
+				'U_VIEWTOPIC'		=> append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&amp;t=$topic_id"),
193
+				'U_VIEWFORUM'		=> append_sid($this->phpbb_root_path.'viewforum.'.$this->php_ext, "f=$forum_id"),
194
+				'U_NEW_POST'		=> append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&amp;t=$topic_id&amp;view=unread").'#unread',
195
+				'U_LAST_POST'		=> append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&amp;t=$topic_id&amp;p=".$row['topic_last_post_id']).'#p'.$row['topic_last_post_id'],
196 196
 			));
197 197
 			unset($topic_data[$i], $post_data[$topic_id]);
198 198
 		}
Please login to merge, or discard this patch.
services/blocks/blocks.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -178,8 +178,7 @@
 block discarded – undo
178 178
 		if (!empty($block['content']))
179 179
 		{
180 180
 			$content = $block['content'];
181
-		}
182
-		else if ($edit_mode)
181
+		} else if ($edit_mode)
183 182
 		{
184 183
 			$content = $this->user->lang('BLOCK_NO_DATA');
185 184
 		}
Please login to merge, or discard this patch.
blocks/featured_member.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if (is_array($message))
42 42
 		{
43 43
 			$this->message = (string) $message[0];
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			$this->message = $message;
48 47
 		}
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	private function change_user()
148 148
 	{
149 149
 		$change = false;
150
-		if ($this->settings['rotation'] == 'pageload' || $this->settings['last_changed'] < strtotime('-1 ' . self::$rotations[$this->settings['rotation']]))
150
+		if ($this->settings['rotation'] == 'pageload' || $this->settings['last_changed'] < strtotime('-1 '.self::$rotations[$this->settings['rotation']]))
151 151
 		{
152 152
 			$this->settings['last_changed'] = time();
153 153
 			$change = true;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	private function get_settings(array $bdata)
164 164
 	{
165
-		$cached_settings = $this->cache->get('pt_block_data_' . $bdata['bid']);
165
+		$cached_settings = $this->cache->get('pt_block_data_'.$bdata['bid']);
166 166
 		$settings = ($cached_settings && $cached_settings['hash'] === $bdata['hash']) ? $cached_settings : $bdata['settings'];
167 167
 		$settings['hash'] = $bdata['hash'];
168 168
 
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 			$sql_data = array(
183 183
 				'settings'	=> json_encode($settings)
184 184
 			);
185
-			$this->db->sql_query('UPDATE ' . $this->blocks_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_data) . ' WHERE bid = ' . (int) $bid);
186
-			$this->cache->put('pt_block_data_' . $bid, $this->settings);
185
+			$this->db->sql_query('UPDATE '.$this->blocks_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_data).' WHERE bid = '.(int) $bid);
186
+			$this->cache->put('pt_block_data_'.$bid, $this->settings);
187 187
 		}
188 188
 	}
189 189
 
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 		$rotation = $this->settings['rotation'];
236 236
 
237 237
 		$this->ptemplate->assign_vars(array(
238
-			'QTYPE_EXPLAIN'		=> ($query_type == 'posts' || $query_type == 'recent') ? $this->translator->lang('QTYPE_' . strtoupper($query_type)) : '',
239
-			'TITLE_EXPLAIN'		=> ($rotation != 'pageload') ? $this->translator->lang(strtoupper($rotation) . '_MEMBER') : '',
238
+			'QTYPE_EXPLAIN'		=> ($query_type == 'posts' || $query_type == 'recent') ? $this->translator->lang('QTYPE_'.strtoupper($query_type)) : '',
239
+			'TITLE_EXPLAIN'		=> ($rotation != 'pageload') ? $this->translator->lang(strtoupper($rotation).'_MEMBER') : '',
240 240
 		));
241 241
 	}
242 242
 
Please login to merge, or discard this patch.