@@ -13,8 +13,8 @@ |
||
| 13 | 13 | { |
| 14 | 14 | public function execute($style_id) |
| 15 | 15 | { |
| 16 | - $name = $this->request->variable('block', ''); |
|
| 17 | - $route = $this->request->variable('route', ''); |
|
| 16 | + $name = $this->request->variable('block', ''); |
|
| 17 | + $route = $this->request->variable('route', ''); |
|
| 18 | 18 | |
| 19 | 19 | if (($block_instance = $this->block_factory->get_block($name)) === null) |
| 20 | 20 | { |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $headers = $headers[0]; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - preg_match('/HTTP\/.* ([0-9]+) .*/', $headers , $status); |
|
| 32 | + preg_match('/HTTP\/.* ([0-9]+) .*/', $headers, $status); |
|
| 33 | 33 | |
| 34 | 34 | return ($status[1] == 200) ? true : false; |
| 35 | 35 | } |
@@ -339,7 +339,7 @@ |
||
| 339 | 339 | $this->store['topic'][$row['topic_id']] = $row; |
| 340 | 340 | |
| 341 | 341 | $this->store['tracking'][$row['forum_id']]['topic_list'][] = $row['topic_id']; |
| 342 | - $this->store['tracking'][$row['forum_id']]['mark_time'] =& $row['forum_mark_time']; |
|
| 342 | + $this->store['tracking'][$row['forum_id']]['mark_time'] = & $row['forum_mark_time']; |
|
| 343 | 343 | $this->store['post_ids']['first'][] = $row['topic_first_post_id']; |
| 344 | 344 | $this->store['post_ids']['last'][] = $row['topic_last_post_id']; |
| 345 | 345 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | { |
| 122 | 122 | $this->_entities = array_filter( |
| 123 | 123 | $this->_entities, |
| 124 | - function ($v) use ($key) |
|
| 124 | + function($v) use ($key) |
|
| 125 | 125 | { |
| 126 | 126 | return $v !== $key; |
| 127 | 127 | } |
@@ -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; |
@@ -78,7 +78,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | $right = $row['right_id']; |
| 220 | - $title = $padding . '├─ ' . $row[$title_column]; |
|
| 220 | + $title = $padding.'├─ '.$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 | |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | class invalid_argument extends base |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * Translate this exception |
|
| 19 | - * |
|
| 20 | - * @param \phpbb\language\language $translator |
|
| 21 | - * @return array|string |
|
| 22 | - * @access public |
|
| 23 | - */ |
|
| 18 | + * Translate this exception |
|
| 19 | + * |
|
| 20 | + * @param \phpbb\language\language $translator |
|
| 21 | + * @return array|string |
|
| 22 | + * @access public |
|
| 23 | + */ |
|
| 24 | 24 | public function get_message(\phpbb\language\language $translator) |
| 25 | 25 | { |
| 26 | 26 | return $this->translate_portions($translator, $this->message_full, 'EXCEPTION_INVALID_ARGUMENT'); |
@@ -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']); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function save(\blitze\sitemaker\model\entity_interface $entity) |
| 87 | 87 | { |
| 88 | - $accessor = 'get_' . $this->entity_pkey; |
|
| 88 | + $accessor = 'get_'.$this->entity_pkey; |
|
| 89 | 89 | if (is_null($entity->$accessor())) |
| 90 | 90 | { |
| 91 | 91 | $entity = $this->insert($entity); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | if ($condition instanceof $this->entity_class) |
| 109 | 109 | { |
| 110 | - $accessor = 'get_' . $this->entity_pkey; |
|
| 110 | + $accessor = 'get_'.$this->entity_pkey; |
|
| 111 | 111 | $condition = array($this->entity_pkey, '=', $condition->$accessor()); |
| 112 | 112 | } |
| 113 | 113 | else |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $sql_where = $this->get_sql_condition($condition); |
| 120 | - $this->db->sql_query('DELETE FROM ' . $this->entity_table . (sizeof($sql_where) ? ' WHERE ' . join(' AND ', $sql_where) : '')); |
|
| 120 | + $this->db->sql_query('DELETE FROM '.$this->entity_table.(sizeof($sql_where) ? ' WHERE '.join(' AND ', $sql_where) : '')); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -136,9 +136,9 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | protected function insert(\blitze\sitemaker\model\entity_interface $entity) |
| 138 | 138 | { |
| 139 | - $this->db->sql_query('INSERT INTO ' . $this->entity_table . ' ' . $this->db->sql_build_array('INSERT', $entity->to_db())); |
|
| 139 | + $this->db->sql_query('INSERT INTO '.$this->entity_table.' '.$this->db->sql_build_array('INSERT', $entity->to_db())); |
|
| 140 | 140 | |
| 141 | - $mutator = 'set_' . $this->entity_pkey; |
|
| 141 | + $mutator = 'set_'.$this->entity_pkey; |
|
| 142 | 142 | $entity->$mutator((int) $this->db->sql_nextid()); |
| 143 | 143 | |
| 144 | 144 | return $entity; |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | protected function update(\blitze\sitemaker\model\entity_interface $entity) |
| 154 | 154 | { |
| 155 | - $accessor = 'get_' . $this->entity_pkey; |
|
| 155 | + $accessor = 'get_'.$this->entity_pkey; |
|
| 156 | 156 | |
| 157 | - return $this->db->sql_query('UPDATE ' . $this->entity_table . ' |
|
| 158 | - SET ' . $this->db->sql_build_array('UPDATE', $entity->to_db()) . ' |
|
| 159 | - WHERE ' . $this->entity_pkey . ' = ' . (int) $entity->$accessor()); |
|
| 157 | + return $this->db->sql_query('UPDATE '.$this->entity_table.' |
|
| 158 | + SET ' . $this->db->sql_build_array('UPDATE', $entity->to_db()).' |
|
| 159 | + WHERE ' . $this->entity_pkey.' = '.(int) $entity->$accessor()); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | protected function find_sql(array $sql_where) |
| 167 | 167 | { |
| 168 | - return 'SELECT * FROM ' . $this->entity_table . |
|
| 169 | - (sizeof($sql_where) ? ' WHERE ' . join(' AND ', $sql_where) : ''); |
|
| 168 | + return 'SELECT * FROM '.$this->entity_table. |
|
| 169 | + (sizeof($sql_where) ? ' WHERE '.join(' AND ', $sql_where) : ''); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | list($field, $operator, $value) = $info; |
| 184 | 184 | |
| 185 | - $callable = 'get_sql_where_' . gettype($value); |
|
| 185 | + $callable = 'get_sql_where_'.gettype($value); |
|
| 186 | 186 | if (is_callable(array($this, $callable))) |
| 187 | 187 | { |
| 188 | 188 | $sql_where[] = call_user_func_array(array($this, $callable), array($field, $value, $operator)); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | protected function get_sql_where_string($field, $value, $operator) |
| 222 | 222 | { |
| 223 | - return $field . " $operator '" . $this->db->sql_escape($value) . "'"; |
|
| 223 | + return $field." $operator '".$this->db->sql_escape($value)."'"; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | protected function get_sql_where_integer($field, $value, $operator) |
| 233 | 233 | { |
| 234 | - return $field . " $operator " . (int) $value; |
|
| 234 | + return $field." $operator ".(int) $value; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |