@@ -260,8 +260,7 @@ |
||
260 | 260 | 'depth' => $new_parent['depth'] + 1, |
261 | 261 | 'right_id' => --$new_parent['right_id'], |
262 | 262 | ); |
263 | - } |
|
264 | - else |
|
263 | + } else |
|
265 | 264 | { |
266 | 265 | return array( |
267 | 266 | 'depth' => 0, |
@@ -55,8 +55,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -41,8 +41,7 @@ |
||
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 | } |
@@ -96,10 +96,10 @@ |
||
96 | 96 | foreach ($this->message_full as &$message) |
97 | 97 | { |
98 | 98 | // Attempt to translate each portion |
99 | - $translated_message = $translator->lang('EXCEPTION_' . $message); |
|
99 | + $translated_message = $translator->lang('EXCEPTION_'.$message); |
|
100 | 100 | |
101 | 101 | // Check if translating did anything |
102 | - if ($translated_message !== 'EXCEPTION_' . $message) |
|
102 | + if ($translated_message !== 'EXCEPTION_'.$message) |
|
103 | 103 | { |
104 | 104 | // It did, so replace message with the translated version |
105 | 105 | $message = $translated_message; |
@@ -33,13 +33,13 @@ |
||
33 | 33 | protected $data = array(); |
34 | 34 | |
35 | 35 | /** |
36 | - * Construct |
|
37 | - * |
|
38 | - * @param \phpbb\db\driver\driver_interface $db Database connection |
|
39 | - * @param string $items_table Table name |
|
40 | - * @param string $pk Primary key |
|
41 | - * @param string $sql_where Column restriction |
|
42 | - */ |
|
36 | + * Construct |
|
37 | + * |
|
38 | + * @param \phpbb\db\driver\driver_interface $db Database connection |
|
39 | + * @param string $items_table Table name |
|
40 | + * @param string $pk Primary key |
|
41 | + * @param string $sql_where Column restriction |
|
42 | + */ |
|
43 | 43 | public function __construct(\phpbb\db\driver\driver_interface $db, $items_table, $pk, $sql_where = '') |
44 | 44 | { |
45 | 45 | $this->db = $db; |
@@ -254,8 +254,7 @@ |
||
254 | 254 | { |
255 | 255 | $padding .= $pad_with; |
256 | 256 | $padding_store[$row[$this->column_parent_id]] = $padding; |
257 | - } |
|
258 | - else if ($row[$this->column_left_id] > $right + 1) |
|
257 | + } else if ($row[$this->column_left_id] > $right + 1) |
|
259 | 258 | { |
260 | 259 | $padding = (isset($padding_store[$row[$this->column_parent_id]])) ? $padding_store[$row[$this->column_parent_id]] : ''; |
261 | 260 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $sql = "SELECT * |
91 | 91 | FROM $this->items_table |
92 | - WHERE $this->pk = " . (int) $node_id ; |
|
92 | + WHERE $this->pk = ".(int) $node_id; |
|
93 | 93 | $result = $this->db->sql_query($sql); |
94 | 94 | $row = $this->db->sql_fetchrow($result); |
95 | 95 | $this->db->sql_freeresult($result); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $this->items_table => 'i' |
119 | 119 | ), |
120 | 120 | 'WHERE' => array( |
121 | - 'i.depth ' . (($max_depth) ? ' BETWEEN ' . (int) $start . ' AND ' . (int) ($start + $max_depth) : ' >= ' . (int) $start), |
|
121 | + 'i.depth '.(($max_depth) ? ' BETWEEN '.(int) $start.' AND '.(int) ($start + $max_depth) : ' >= '.(int) $start), |
|
122 | 122 | $this->sql_where, |
123 | 123 | ), |
124 | 124 | 'ORDER_BY' => 'i.left_id ASC', |
@@ -174,22 +174,22 @@ discard block |
||
174 | 174 | for ($i = 0, $size = sizeof($data); $i < $size; $i++) |
175 | 175 | { |
176 | 176 | $row = $data[$i]; |
177 | - $this_depth = $parental_depth[$row[$this->column_parent_id]] + 1; |
|
178 | - $repeat = abs($prev_depth - $this_depth); |
|
177 | + $this_depth = $parental_depth[$row[$this->column_parent_id]] + 1; |
|
178 | + $repeat = abs($prev_depth - $this_depth); |
|
179 | 179 | |
180 | - $tpl_data = array( |
|
180 | + $tpl_data = array( |
|
181 | 181 | 'PREV_DEPTH' => $prev_depth, |
182 | 182 | 'THIS_DEPTH' => $this_depth, |
183 | 183 | 'NUM_KIDS' => $this->count_descendants($row), |
184 | 184 | ); |
185 | 185 | |
186 | 186 | $template->assign_block_vars($handle, array_merge($tpl_data, array_change_key_case($row, CASE_UPPER))); |
187 | - $this->recursively_close_tags($repeat, $handle . '.close', $template); |
|
187 | + $this->recursively_close_tags($repeat, $handle.'.close', $template); |
|
188 | 188 | |
189 | 189 | $prev_depth = $this_depth; |
190 | 190 | $parental_depth[$row[$this->pk]] = $this_depth; |
191 | 191 | } |
192 | - $this->recursively_close_tags($prev_depth, 'close_' . $handle, $template); |
|
192 | + $this->recursively_close_tags($prev_depth, 'close_'.$handle, $template); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | for ($i = 0; $i < $repeat; $i++) |
204 | 204 | { |
205 | - $template->assign_block_vars('close_' . $handle, array()); |
|
205 | + $template->assign_block_vars('close_'.$handle, array()); |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | protected function get_padded_title($padding, $title) |
270 | 270 | { |
271 | - return (($padding) ? $padding . '⤷ ' : '') . $title; |
|
271 | + return (($padding) ? $padding.'⤷ ' : '').$title; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -280,6 +280,6 @@ discard block |
||
280 | 280 | protected function get_html_option(array $row, array $selected_ids, $title) |
281 | 281 | { |
282 | 282 | $selected = (in_array($row[$this->pk], $selected_ids)) ? ' selected="selected' : ''; |
283 | - return '<option value="' . $row[$this->pk] . '"' . $selected . '>' . $title . '</option>'; |
|
283 | + return '<option value="'.$row[$this->pk].'"'.$selected.'>'.$title.'</option>'; |
|
284 | 284 | } |
285 | 285 | } |
@@ -40,8 +40,7 @@ |
||
40 | 40 | if ($this->can_track_by_lastread()) |
41 | 41 | { |
42 | 42 | $info = $this->build_tracking_info('get_topic_tracking', $forums, $topics); |
43 | - } |
|
44 | - else if ($this->can_track_anonymous()) |
|
43 | + } else if ($this->can_track_anonymous()) |
|
45 | 44 | { |
46 | 45 | $info = $this->build_tracking_info('get_complete_topic_tracking', $forums, $topics); |
47 | 46 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * {@inheritdoc} |
|
60 | - */ |
|
59 | + * {@inheritdoc} |
|
60 | + */ |
|
61 | 61 | public function to_array() |
62 | 62 | { |
63 | 63 | $attributes = $this->get_attributes(); |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * {@inheritdoc} |
|
78 | - */ |
|
77 | + * {@inheritdoc} |
|
78 | + */ |
|
79 | 79 | public function to_db() |
80 | 80 | { |
81 | 81 | $this->check_required(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | foreach ($data as $name => $value) |
27 | 27 | { |
28 | - $mutator = 'set_' . $name; |
|
28 | + $mutator = 'set_'.$name; |
|
29 | 29 | $this->$mutator($value); |
30 | 30 | } |
31 | 31 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $data = array(); |
66 | 66 | foreach ($attributes as $attribute) |
67 | 67 | { |
68 | - $accessor = 'get_' . $attribute; |
|
68 | + $accessor = 'get_'.$attribute; |
|
69 | 69 | $data[$attribute] = $this->$accessor(); |
70 | 70 | } |
71 | 71 | unset($data['db_fields'], $data['required_fields']); |
@@ -43,8 +43,7 @@ |
||
43 | 43 | if ('get' == $match[1]) |
44 | 44 | { |
45 | 45 | return $this->$attribute; |
46 | - } |
|
47 | - else |
|
46 | + } else |
|
48 | 47 | { |
49 | 48 | $this->$attribute = $this->validate_attribute($match[2], $args[0]); |
50 | 49 | return $this; |
@@ -59,6 +59,6 @@ |
||
59 | 59 | $class_name = get_class($block_instance); |
60 | 60 | list($namespace, $extension) = explode('\\', $class_name); |
61 | 61 | |
62 | - return $namespace . '/' . $extension; |
|
62 | + return $namespace.'/'.$extension; |
|
63 | 63 | } |
64 | 64 | } |
@@ -34,7 +34,7 @@ |
||
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 | $entity = $block_mapper->save($entity); |
40 | 40 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function create($action) |
65 | 65 | { |
66 | - $action_class = 'blitze\\sitemaker\\services\\blocks\\action\\' . $action; |
|
66 | + $action_class = 'blitze\\sitemaker\\services\\blocks\\action\\'.$action; |
|
67 | 67 | |
68 | 68 | if (!class_exists($action_class)) |
69 | 69 | { |
@@ -38,7 +38,7 @@ |
||
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, |