| @@ -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; | 
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 |  	{ | 
| 80 | 80 | $sql = "SELECT * | 
| 81 | 81 | FROM $this->items_table | 
| 82 | - WHERE $this->pk = " . (int) $node_id ; | |
| 82 | + WHERE $this->pk = ".(int) $node_id; | |
| 83 | 83 | $result = $this->db->sql_query($sql); | 
| 84 | 84 | $row = $this->db->sql_fetchrow($result); | 
| 85 | 85 | $this->db->sql_freeresult($result); | 
| @@ -108,8 +108,8 @@ discard block | ||
| 108 | 108 | $this->items_table => 'i' | 
| 109 | 109 | ), | 
| 110 | 110 | 'WHERE' => array( | 
| 111 | - 'i.depth ' . (($max_depth) ? " BETWEEN $start AND " . ($start + $max_depth) : ' >= ' . $start), | |
| 112 | - (($this->sql_where) ? 'i.' . $this->sql_where : ''), | |
| 111 | + 'i.depth '.(($max_depth) ? " BETWEEN $start AND ".($start + $max_depth) : ' >= '.$start), | |
| 112 | + (($this->sql_where) ? 'i.'.$this->sql_where : ''), | |
| 113 | 113 | ), | 
| 114 | 114 | 'ORDER_BY' => 'i.left_id ASC', | 
| 115 | 115 | ), | 
| @@ -155,7 +155,7 @@ discard block | ||
| 155 | 155 | * @param \phpbb\template\twig\twig $template | 
| 156 | 156 | * @param string $handle | 
| 157 | 157 | */ | 
| 158 | - public function display_list(array $data, \phpbb\template\twig\twig &$template, $handle = 'tree') | |
| 158 | + public function display_list(array $data, \phpbb\template\twig\twig & $template, $handle = 'tree') | |
| 159 | 159 |  	{ | 
| 160 | 160 | $prev_depth = 0; | 
| 161 | 161 | $parental_depth = array(0 => -1); | 
| @@ -164,10 +164,10 @@ discard block | ||
| 164 | 164 | for ($i = 0, $size = sizeof($data); $i < $size; $i++) | 
| 165 | 165 |  		{ | 
| 166 | 166 | $row = $data[$i]; | 
| 167 | - $this_depth = $parental_depth[$row['parent_id']] + 1; | |
| 168 | - $repeat = abs($prev_depth - $this_depth); | |
| 167 | + $this_depth = $parental_depth[$row['parent_id']] + 1; | |
| 168 | + $repeat = abs($prev_depth - $this_depth); | |
| 169 | 169 | |
| 170 | - $tpl_data = array( | |
| 170 | + $tpl_data = array( | |
| 171 | 171 | 'PREV_DEPTH' => $prev_depth, | 
| 172 | 172 | 'THIS_DEPTH' => $this_depth, | 
| 173 | 173 | 'NUM_KIDS' => $this->count_descendants($row), | 
| @@ -177,7 +177,7 @@ discard block | ||
| 177 | 177 | |
| 178 | 178 | for ($j = 0; $j < $repeat; $j++) | 
| 179 | 179 |  			{ | 
| 180 | - $template->assign_block_vars($handle . '.close', array()); | |
| 180 | + $template->assign_block_vars($handle.'.close', array()); | |
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | $prev_depth = $this_depth; | 
| @@ -186,7 +186,7 @@ discard block | ||
| 186 | 186 | |
| 187 | 187 | for ($i = 0; $i < $prev_depth; $i++) | 
| 188 | 188 |  		{ | 
| 189 | -			$template->assign_block_vars('close_' . $handle, array()); | |
| 189 | +			$template->assign_block_vars('close_'.$handle, array()); | |
| 190 | 190 | } | 
| 191 | 191 | } | 
| 192 | 192 | |
| @@ -225,10 +225,10 @@ discard block | ||
| 225 | 225 | } | 
| 226 | 226 | |
| 227 | 227 | $right = $row['right_id']; | 
| 228 | - $title = $padding . '├─ ' . $row[$title_column]; | |
| 228 | + $title = $padding.'├─ '.$row[$title_column]; | |
| 229 | 229 | $selected = (in_array($row[$this->pk], $selected_ids)) ? ' selected="selected' : ''; | 
| 230 | 230 | |
| 231 | - $return_options .= '<option value="' . $row[$this->pk] . '"' . $selected . '>' . $title . '</option>'; | |
| 231 | + $return_options .= '<option value="'.$row[$this->pk].'"'.$selected.'>'.$title.'</option>'; | |
| 232 | 232 | $return_data[$row[$this->pk]] = $title; | 
| 233 | 233 | } | 
| 234 | 234 | |
| @@ -91,8 +91,8 @@ discard block | ||
| 91 | 91 | */ | 
| 92 | 92 | private function clean_styles() | 
| 93 | 93 |  	{ | 
| 94 | - $routes_ary = $this->manager->get_routes_per_style(); | |
| 95 | - $style_ids = $this->get_style_ids(); | |
| 94 | + $routes_ary = $this->manager->get_routes_per_style(); | |
| 95 | + $style_ids = $this->get_style_ids(); | |
| 96 | 96 | |
| 97 | 97 | $routes = array(); | 
| 98 | 98 | foreach ($routes_ary as $style_id => $style_routes) | 
| @@ -122,7 +122,7 @@ discard block | ||
| 122 | 122 | |
| 123 | 123 | foreach ($routes as $route => $row) | 
| 124 | 124 |  		{ | 
| 125 | - $url = $board_url . '/' . (($row['ext_name']) ? 'app.php' : '') . $row['route']; | |
| 125 | + $url = $board_url.'/'.(($row['ext_name']) ? 'app.php' : '').$row['route']; | |
| 126 | 126 | |
| 127 | 127 | // Route no longer exists => remove all blocks for route | 
| 128 | 128 | if ($this->url_checker->exists($url) !== true) | 
| @@ -185,7 +185,7 @@ discard block | ||
| 185 | 185 | |
| 186 | 186 | if (sizeof($block_ids)) | 
| 187 | 187 |  		{ | 
| 188 | -			$this->db->sql_query('DELETE FROM ' . $this->cblocks_table . ' WHERE ' . $this->db->sql_in_set('block_id', $block_ids)); | |
| 188 | +			$this->db->sql_query('DELETE FROM '.$this->cblocks_table.' WHERE '.$this->db->sql_in_set('block_id', $block_ids)); | |
| 189 | 189 | } | 
| 190 | 190 | } | 
| 191 | 191 | |
| @@ -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']); | 
| @@ -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 |  		{ | 
| @@ -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); | 
| @@ -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, | 
| @@ -64,8 +64,8 @@ discard block | ||
| 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 | ||
| 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)); |