Completed
Push — master ( e581ca...436d2e )
by Daniel
08:58
created
services/tree/builder.php 1 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.
services/tree/display.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	{
79 79
 		$sql = "SELECT *
80 80
 			FROM $this->items_table
81
-			WHERE $this->pk = " . (int) $node_id ;
81
+			WHERE $this->pk = ".(int) $node_id;
82 82
 		$result = $this->db->sql_query($sql);
83 83
 		$row = $this->db->sql_fetchrow($result);
84 84
 		$this->db->sql_freeresult($result);
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 					$this->items_table => ' t'
108 108
 				),
109 109
 				'WHERE'		=> array(
110
-					't.depth ' . (($level) ? " BETWEEN $start AND " . ($start + $level) : ' >= ' . $start),
111
-					(($this->sql_where) ? 't.' . $this->sql_where : ''),
110
+					't.depth '.(($level) ? " BETWEEN $start AND ".($start + $level) : ' >= '.$start),
111
+					(($this->sql_where) ? 't.'.$this->sql_where : ''),
112 112
 				),
113 113
 				'ORDER_BY'	=> 't.left_id ASC',
114 114
 			),
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * @param \phpbb\template\twig\twig $template
148 148
 	 * @param string $handle
149 149
 	 */
150
-	public function display_list(array $data, \phpbb\template\twig\twig &$template, $handle = 'tree')
150
+	public function display_list(array $data, \phpbb\template\twig\twig & $template, $handle = 'tree')
151 151
 	{
152 152
 		$prev_depth = 0;
153 153
 		$parental_depth = array(0 => -1);
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
 		for ($i = 0, $size = sizeof($data); $i < $size; $i++)
157 157
 		{
158 158
 			$row 		= $data[$i];
159
-			$this_depth	= $parental_depth[$row['parent_id']] + 1;
160
-			$repeat		= abs($prev_depth - $this_depth);
159
+			$this_depth = $parental_depth[$row['parent_id']] + 1;
160
+			$repeat = abs($prev_depth - $this_depth);
161 161
 
162
-			$tpl_data	= array(
162
+			$tpl_data = array(
163 163
 				'PREV_DEPTH'	=> $prev_depth,
164 164
 				'THIS_DEPTH'	=> $this_depth,
165 165
 				'NUM_KIDS'		=> $this->count_descendants($row),
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
 			for ($j = 0; $j < $repeat; $j++)
171 171
 			{
172
-				$template->assign_block_vars($handle . '.close', array());
172
+				$template->assign_block_vars($handle.'.close', array());
173 173
 			}
174 174
 
175 175
 			$prev_depth = $this_depth;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 		for ($i = 0; $i < $prev_depth; $i++)
180 180
 		{
181
-			$template->assign_block_vars('close_' . $handle, array());
181
+			$template->assign_block_vars('close_'.$handle, array());
182 182
 		}
183 183
 	}
184 184
 
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 			}
218 218
 
219 219
 			$right = $row['right_id'];
220
-			$title = $padding . '&#x251c;&#x2500; ' . $row[$title_column];
220
+			$title = $padding.'&#x251c;&#x2500; '.$row[$title_column];
221 221
 			$selected = (in_array($row[$this->pk], $selected_ids)) ? ' selected="selected' : '';
222 222
 
223
-			$return_options .= '<option value="' . $row[$this->pk] . '"' . $selected . '>' . $title . '</option>';
223
+			$return_options .= '<option value="'.$row[$this->pk].'"'.$selected.'>'.$title.'</option>';
224 224
 			$return_data[$row[$this->pk]] = $title;
225 225
 		}
226 226
 
Please login to merge, or discard this patch.
services/date_range.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 		$time = $this->user->create_datetime($this->time);
39 39
 		$now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
40 40
 
41
-		$method = 'get_' . $range;
41
+		$method = 'get_'.$range;
42 42
 		$data = array(
43 43
 			'start'	=> 0,
44 44
 			'stop'	=> 0,
Please login to merge, or discard this patch.
services/auto_lang.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 			$default_lang_files = $finder
65 65
 				->prefix($lang_file)
66 66
 				->suffix(".$this->php_ext")
67
-				->extension_directory('/language/' . basename($this->config['default_lang']))
68
-				->core_path('language/' . basename($this->config['default_lang']) . '/')
67
+				->extension_directory('/language/'.basename($this->config['default_lang']))
68
+				->core_path('language/'.basename($this->config['default_lang']).'/')
69 69
 				->find();
70 70
 		}
71 71
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 		$user_lang_files = $finder
85 85
 			->prefix($lang_file)
86 86
 			->suffix(".$this->php_ext")
87
-			->extension_directory('/language/' . $this->user->lang_name)
88
-			->core_path('language/' . $this->user->lang_name . '/')
87
+			->extension_directory('/language/'.$this->user->lang_name)
88
+			->core_path('language/'.$this->user->lang_name.'/')
89 89
 			->find();
90 90
 
91 91
 		$lang_files = array_unique(array_merge($user_lang_files, $english_lang_files, $default_lang_files));
Please login to merge, or discard this patch.
services/menus/action/update_item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
 		if (isset($allowed_fields[$field]))
36 36
 		{
37
-			$mutator = 'set_' . $field;
37
+			$mutator = 'set_'.$field;
38 38
 			$entity->$mutator($allowed_fields[$field]);
39 39
 			$item_mapper->save($entity);
40 40
 		}
Please login to merge, or discard this patch.
services/menus/action_handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 	 */
47 47
 	public function create($action)
48 48
 	{
49
-		$action_class = 'blitze\\sitemaker\\services\\menus\\action\\' . $action;
49
+		$action_class = 'blitze\\sitemaker\\services\\menus\\action\\'.$action;
50 50
 
51 51
 		if (!class_exists($action_class))
52 52
 		{
Please login to merge, or discard this patch.
blocks/attachments.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
 				$this->ptemplate->assign_block_vars('postrow.attachment', array(
139 139
 					'DISPLAY_ATTACHMENT'	=> $attachment,
140 140
 					'EXTENSION_GROUP'		=> $extensions[$row['extension']]['group_name'],
141
-					'U_VIEWTOPIC'			=> append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "t=$topic_id&amp;p=$post_id") . '#p' . $post_id,
141
+					'U_VIEWTOPIC'			=> append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "t=$topic_id&amp;p=$post_id").'#p'.$post_id,
142 142
 				));
143 143
 			}
144 144
 		}
Please login to merge, or discard this patch.
blocks/whois.php 1 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.
blocks/birthday.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function display(array $bdata, $edit_mode = false)
51 51
 	{
52
-		if (($content = $this->cache->get('pt_block_data_' . $bdata['bid'])) === false)
52
+		if (($content = $this->cache->get('pt_block_data_'.$bdata['bid'])) === false)
53 53
 		{
54 54
 			$content = '';
55 55
 			if ($this->find_birthday_users())
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 				$content = $this->ptemplate->render_view('blitze/sitemaker', 'blocks/birthday.html', 'birthday_block');
58 58
 
59 59
 				// we only check birthdays every hour, may make this an admin choice
60
-				$this->cache->put('pt_block_data_' . $bdata['bid'], $content, 3600);
60
+				$this->cache->put('pt_block_data_'.$bdata['bid'], $content, 3600);
61 61
 			}
62 62
 		}
63 63
 
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 		$leap_year_birthdays = $this->adjust_leap_year($now, $time);
79 79
 
80 80
 		$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday 
81
-				FROM ' . USERS_TABLE . ' u
82
-				LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
81
+				FROM ' . USERS_TABLE.' u
82
+				LEFT JOIN ' . BANLIST_TABLE." b ON (u.user_id = b.ban_userid)
83 83
 				WHERE (b.ban_id IS NULL
84 84
 					OR b.ban_exclude = 1)
85
-					AND (u.user_birthday " . $this->db->sql_like_expression(sprintf('%2d-%2d-', $now['mday'], $now['mon']) . $this->db->get_any_char()) . " $leap_year_birthdays)
86
-					AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')
85
+					AND (u.user_birthday " . $this->db->sql_like_expression(sprintf('%2d-%2d-', $now['mday'], $now['mon']).$this->db->get_any_char())." $leap_year_birthdays)
86
+					AND u.user_type IN (".USER_NORMAL.', '.USER_FOUNDER.')
87 87
 				ORDER BY u.username ASC';
88 88
 		$result = $this->db->sql_query($sql);
89 89
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		$leap_year_birthdays = '';
114 114
 		if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L'))
115 115
 		{
116
-			$leap_year_birthdays = ' OR u.user_birthday ' . $this->db->sql_like_expression(sprintf('%2d-%2d-', 29, 2) . $this->db->get_any_char());
116
+			$leap_year_birthdays = ' OR u.user_birthday '.$this->db->sql_like_expression(sprintf('%2d-%2d-', 29, 2).$this->db->get_any_char());
117 117
 		}
118 118
 
119 119
 		return $leap_year_birthdays;
Please login to merge, or discard this patch.