@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | define('INSIDE', true); |
13 | 13 | define('INSTALL', false); |
14 | 14 | define('IN_ADMIN', true); |
15 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
15 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
16 | 16 | |
17 | 17 | global $user; |
18 | -if($user['authlevel'] < 3) { |
|
18 | +if ($user['authlevel'] < 3) { |
|
19 | 19 | AdminMessage(classLocale::$lang['adm_err_denied']); |
20 | 20 | } |
21 | 21 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $sort = sys_get_param_int('sort', SORT_ID); |
40 | 40 | $sort = $sort_fields[$sort] ? $sort : SORT_ID; |
41 | 41 | |
42 | -if(($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) { |
|
42 | +if (($action = sys_get_param_int('action')) && ($user_id = sys_get_param_id('uid'))) { |
|
43 | 43 | $user_selected = DBStaticUser::db_user_by_id($user_id, false, 'id, username, authlevel'); |
44 | - if($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
45 | - switch($action) { |
|
44 | + if ($user_selected['authlevel'] < $user['authlevel'] && $user['authlevel'] >= 3) { |
|
45 | + switch ($action) { |
|
46 | 46 | case ACTION_DELETE: |
47 | 47 | DeleteSelectedUser($user_id); |
48 | 48 | sys_redirect("{$_SERVER['SCRIPT_NAME']}?sort={$sort}"); |
@@ -62,19 +62,19 @@ discard block |
||
62 | 62 | $template = gettemplate('admin/userlist', true); |
63 | 63 | |
64 | 64 | $multi_ip = array(); |
65 | -foreach(DBStaticUser::db_user_list_admin_multiaccounts() as $ip) { |
|
65 | +foreach (DBStaticUser::db_user_list_admin_multiaccounts() as $ip) { |
|
66 | 66 | $multi_ip[$ip['user_lastip']] = $ip['ip_count']; |
67 | 67 | } |
68 | 68 | |
69 | 69 | $geoip = geoip_status(); |
70 | 70 | |
71 | -foreach(DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row ) { |
|
72 | - if($user_row['banaday']) { |
|
71 | +foreach (DBStaticUser::db_user_list_admin_sorted($sort_fields[$sort], $is_players_online_page) as $user_row) { |
|
72 | + if ($user_row['banaday']) { |
|
73 | 73 | $ban_details = db_ban_list_get_details($user_row); |
74 | 74 | } |
75 | 75 | |
76 | 76 | $geoip_info = $geoip ? geoip_ip_info(ip2longu($user_row['user_lastip'])) : array(); |
77 | - foreach($geoip_info as $key => $value) { |
|
77 | + foreach ($geoip_info as $key => $value) { |
|
78 | 78 | $geoip_info[strtoupper($key)] = $value; |
79 | 79 | unset($geoip_info[$key]); |
80 | 80 | } |
@@ -119,10 +119,17 @@ |
||
119 | 119 | return $this; |
120 | 120 | } |
121 | 121 | |
122 | + /** |
|
123 | + * @param string $functionName |
|
124 | + * @param string $alias |
|
125 | + */ |
|
122 | 126 | public function fieldSingleFunction($functionName, $field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
123 | 127 | return $this->field(DbSqlLiteral::build($this->db)->buildSingleArgument($functionName, $field, $alias)); |
124 | 128 | } |
125 | 129 | |
130 | + /** |
|
131 | + * @param string $alias |
|
132 | + */ |
|
126 | 133 | public function fieldCount($field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
127 | 134 | return $this->field(DbSqlLiteral::build($this->db)->count($field, $alias)); |
128 | 135 | } |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | protected function compileFrom() { |
349 | - $this->_compiledQuery[] = 'FROM `{{' . $this->escapeString($this->table) . '}}`'; |
|
349 | + $this->_compiledQuery[] = 'FROM `{{'.$this->escapeString($this->table).'}}`'; |
|
350 | 350 | if (!empty($this->alias)) { |
351 | - $this->_compiledQuery[] = 'AS `' . $this->escapeString($this->alias) . '`'; |
|
351 | + $this->_compiledQuery[] = 'AS `'.$this->escapeString($this->alias).'`'; |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
@@ -358,29 +358,29 @@ discard block |
||
358 | 358 | |
359 | 359 | protected function compileWhere() { |
360 | 360 | // TODO - fields should be escaped !! |
361 | - !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false; |
|
361 | + !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | protected function compileGroupBy() { |
365 | 365 | // TODO - fields should be escaped !! |
366 | 366 | // !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false; |
367 | - !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . $this->selectFieldsToString($this->groupBy) : false; |
|
367 | + !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.$this->selectFieldsToString($this->groupBy) : false; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | protected function compileOrderBy() { |
371 | 371 | // TODO - fields should be escaped !! |
372 | - !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
372 | + !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | protected function compileHaving() { |
376 | 376 | // TODO - fields should be escaped !! |
377 | - !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false; |
|
377 | + !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | protected function compileLimit() { |
381 | 381 | // TODO - fields should be escaped !! |
382 | 382 | if ($limit = $this->fetchOne ? 1 : $this->limit) { |
383 | - $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : ''); |
|
383 | + $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : ''); |
|
384 | 384 | } |
385 | 385 | } |
386 | 386 | |
@@ -424,14 +424,14 @@ discard block |
||
424 | 424 | */ |
425 | 425 | protected function processField($fieldName) { |
426 | 426 | if (is_bool($fieldName)) { |
427 | - $result = (string)intval($fieldName); |
|
427 | + $result = (string) intval($fieldName); |
|
428 | 428 | } elseif (is_numeric($fieldName)) { |
429 | 429 | $result = $fieldName; |
430 | 430 | } elseif (is_null($fieldName)) { |
431 | 431 | $result = 'NULL'; |
432 | 432 | } else { |
433 | 433 | // Field has other type - string or should be convertible to string |
434 | - $result = (string)$fieldName; |
|
434 | + $result = (string) $fieldName; |
|
435 | 435 | if (!$fieldName instanceof DbSqlLiteral) { |
436 | 436 | $result = $this->quoteField($fieldName); |
437 | 437 | } |
@@ -115,6 +115,9 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | + /** |
|
119 | + * @param string $query |
|
120 | + */ |
|
118 | 121 | public function setQuery($query) { |
119 | 122 | $this->query = $query; |
120 | 123 | |
@@ -128,6 +131,9 @@ discard block |
||
128 | 131 | } |
129 | 132 | } |
130 | 133 | |
134 | + /** |
|
135 | + * @param string $comment |
|
136 | + */ |
|
131 | 137 | protected function commentAdd($comment) { |
132 | 138 | if (empty($this->values[static::COMMENT_PLACEHOLDER])) { |
133 | 139 | $this->query .= static::COMMENT_PLACEHOLDER; |
@@ -261,7 +267,7 @@ discard block |
||
261 | 267 | } |
262 | 268 | |
263 | 269 | /** |
264 | - * @return bool|mysqli_result |
|
270 | + * @return mysqli_result |
|
265 | 271 | */ |
266 | 272 | public function getResult() { |
267 | 273 | return $this->statement->get_result(); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // Removing comment placeholder from statement |
165 | 165 | $this->queryPrepared = str_replace(static::COMMENT_PLACEHOLDER, DbSqlHelper::quoteComment($this->comment), $this->queryPrepared); |
166 | 166 | // Removing comment value from values list |
167 | - $this->paramsPrepared = array_filter($this->paramsPrepared, function ($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
167 | + $this->paramsPrepared = array_filter($this->paramsPrepared, function($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
168 | 168 | // TODO - Add comment value directly to statement |
169 | 169 | } |
170 | 170 | |
@@ -268,9 +268,9 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | public function getIterator() { |
271 | - if(DbSqlPrepare::$isUseGetResult) { |
|
271 | + if (DbSqlPrepare::$isUseGetResult) { |
|
272 | 272 | $mysqli_result = $this->statement->get_result(); |
273 | - if($mysqli_result instanceof mysqli_result) { |
|
273 | + if ($mysqli_result instanceof mysqli_result) { |
|
274 | 274 | $iterator = new DbMysqliResultIterator($this->statement->get_result()); |
275 | 275 | } else { |
276 | 276 | $iterator = new DbEmptyIterator(); |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | global $user; |
6 | 6 | |
7 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
7 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
8 | 8 | $error_message = classSupernova::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
9 | 9 | !classSupernova::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
10 | 10 | ); |
11 | 11 | |
12 | - if($error_message) { |
|
12 | + if ($error_message) { |
|
13 | 13 | message(classLocale::$lang[$error_message], classLocale::$lang['sys_error'], 'overview.php', 10); |
14 | 14 | die(); |
15 | 15 | } |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | $current_round = intval(classSupernova::$config->db_loadItem('game_blitz_register_round')); |
19 | 19 | $current_price = intval(classSupernova::$config->db_loadItem('game_blitz_register_price')); |
20 | 20 | |
21 | -if(classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
21 | +if (classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
22 | 22 | sn_db_transaction_start(); |
23 | 23 | $user = DBStaticUser::db_user_by_id($user['id'], true); |
24 | 24 | $is_registered = db_blitz_reg_get_id_by_player_and_round($user, $current_round); |
25 | - if(sys_get_param_str('register_me')) { |
|
26 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
25 | + if (sys_get_param_str('register_me')) { |
|
26 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
27 | 27 | db_blitz_reg_insert($user, $current_round); |
28 | 28 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
29 | 29 | } |
30 | - } elseif(sys_get_param_str('register_me_not') && !empty($is_registered)) { |
|
30 | + } elseif (sys_get_param_str('register_me_not') && !empty($is_registered)) { |
|
31 | 31 | db_blitz_reg_delete($user, $current_round); |
32 | 32 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION_CANCEL, $current_price, "Отмена регистрации в раунде {$current_round} Блица"); |
33 | 33 | } |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | $blitz_players = 0; |
43 | 43 | $blitz_prize_dark_matter = 0; |
44 | 44 | $blitz_prize_places = 0; |
45 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
46 | - if(sys_get_param_str('generate')) { |
|
45 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
46 | + if (sys_get_param_str('generate')) { |
|
47 | 47 | $next_id = 0; |
48 | 48 | $query = db_blitz_reg_get_random_id($current_round); |
49 | - while($row = db_fetch($query)) { |
|
49 | + while ($row = db_fetch($query)) { |
|
50 | 50 | $next_id++; |
51 | - $blitz_name = 'Игрок' . $next_id; |
|
51 | + $blitz_name = 'Игрок'.$next_id; |
|
52 | 52 | $blitz_password = sys_random_string(8); |
53 | 53 | db_blitz_reg_update_with_name_and_password($blitz_name, $blitz_password, $row, $current_round); |
54 | 54 | } |
55 | - } elseif(sys_get_param_str('import_generated')) { |
|
55 | + } elseif (sys_get_param_str('import_generated')) { |
|
56 | 56 | // ЭТО НА БЛИЦЕ!!! |
57 | 57 | DBStaticUser::db_player_list_blitz_delete_players(); |
58 | 58 | DBStaticPlanet::db_planets_purge(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $system = $system_step; |
75 | 75 | $planet = round(Vector::$knownPlanets / 2); |
76 | 76 | |
77 | - foreach($imported_string as &$string_data) { |
|
77 | + foreach ($imported_string as &$string_data) { |
|
78 | 78 | $string_data = explode(',', $string_data); |
79 | 79 | $username_safe = $string_data[0]; |
80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false); |
96 | 96 | |
97 | - if(($system += $system_step) >= Vector::$knownSystems) { |
|
97 | + if (($system += $system_step) >= Vector::$knownSystems) { |
|
98 | 98 | $galaxy++; |
99 | 99 | $system = $system_step; |
100 | 100 | } |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->users_amount + $new_players); |
105 | 105 | // pdump($imported_string); |
106 | 106 | // generated_string |
107 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
107 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
108 | 108 | $blitz_result = explode(';', $blitz_result_string); |
109 | 109 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
110 | 110 | unset($blitz_result[0]); |
111 | - foreach($blitz_result as $blitz_result_data) { |
|
111 | + foreach ($blitz_result as $blitz_result_data) { |
|
112 | 112 | $blitz_result_data = explode(',', $blitz_result_data); |
113 | - if(count($blitz_result_data) == 5) { |
|
113 | + if (count($blitz_result_data) == 5) { |
|
114 | 114 | $blitz_result_data[1] = db_escape($blitz_result_data[1]); |
115 | 115 | db_blitz_reg_update_results($blitz_result_data, $current_round); |
116 | 116 | } |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | $blitz_result = array(); |
119 | 119 | } |
120 | 120 | |
121 | - if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
121 | + if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
122 | 122 | $blitz_result = array(classSupernova::$config->db_loadItem('var_stat_update')); |
123 | - foreach(DBStaticUser::db_player_list_export_blitz_info() as $row) { |
|
123 | + foreach (DBStaticUser::db_player_list_export_blitz_info() as $row) { |
|
124 | 124 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
125 | 125 | } |
126 | 126 | } else { |
127 | 127 | $query = db_blitz_reg_get_player_list($current_round); |
128 | - while($row = db_fetch($query)) { |
|
128 | + while ($row = db_fetch($query)) { |
|
129 | 129 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
130 | 130 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
131 | 131 | $blitz_players++; |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | $blitz_prize_dark_matter = $blitz_prize_players_active * 20000; |
134 | 134 | $blitz_prize_places = ceil($blitz_prize_players_active / 5); |
135 | 135 | |
136 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
136 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
137 | 137 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
138 | 138 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
139 | 139 | sn_db_transaction_start(); |
140 | 140 | $query = db_blitz_reg_get_player_list_order_by_place($current_round); |
141 | - while($row = db_fetch($query)) { |
|
142 | - if(!$row['blitz_place']) { |
|
141 | + while ($row = db_fetch($query)) { |
|
142 | + if (!$row['blitz_place']) { |
|
143 | 143 | continue; |
144 | 144 | } |
145 | 145 | |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | |
149 | 149 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
150 | 150 | pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
151 | - if($reward) { |
|
151 | + if ($reward) { |
|
152 | 152 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
153 | 153 | classLocale::$lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
154 | 154 | )); |
155 | 155 | db_blitz_reg_update_apply_results($reward, $row, $current_round); |
156 | 156 | } |
157 | 157 | |
158 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
158 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
159 | 159 | break; |
160 | 160 | } |
161 | 161 | } |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | |
171 | 171 | $player_registered = false; |
172 | 172 | $query = db_blitz_reg_get_player_list_and_users($current_round); |
173 | -while($row = db_fetch($query)) { |
|
173 | +while ($row = db_fetch($query)) { |
|
174 | 174 | $tpl_player_data = array( |
175 | 175 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
176 | 176 | ); |
177 | 177 | |
178 | - if(classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
178 | + if (classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
179 | 179 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
180 | 180 | $tpl_player_data = array_merge($tpl_player_data, array( |
181 | 181 | 'ID' => $row['id'], |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | $template->assign_block_vars('registrations', $tpl_player_data); |
191 | - if($row['id'] == $user['id']) { |
|
191 | + if ($row['id'] == $user['id']) { |
|
192 | 192 | $player_registered = $row; |
193 | 193 | } |
194 | 194 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | $fields[0] = &$this->_result; |
16 | 16 | |
17 | - while($field = mysqli_fetch_field($data)) { |
|
17 | + while ($field = mysqli_fetch_field($data)) { |
|
18 | 18 | $fields[] = &$out[$field->name]; |
19 | 19 | } |
20 | 20 |
@@ -101,7 +101,7 @@ |
||
101 | 101 | static::makeArrayRef($arrayNew); |
102 | 102 | static::makeArrayRef($arrayOld); |
103 | 103 | |
104 | - switch($mergeStrategy) { |
|
104 | + switch ($mergeStrategy) { |
|
105 | 105 | case HelperArray::MERGE_PHP: |
106 | 106 | $arrayOld = array_merge($arrayOld, $arrayNew); |
107 | 107 | break; |
@@ -118,7 +118,7 @@ |
||
118 | 118 | * @param mixed $offset <p> |
119 | 119 | * The offset to assign the value to. |
120 | 120 | * </p> |
121 | - * @param mixed $value <p> |
|
121 | + * @param Unit $value <p> |
|
122 | 122 | * The value to set. |
123 | 123 | * </p> |
124 | 124 | * |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | * @param array $arguments |
20 | 20 | */ |
21 | 21 | public function __call($method_name, array $arguments) { |
22 | - foreach($this->_container as $object) { |
|
23 | - if(is_object($object) && method_exists($object, $method_name)) { |
|
22 | + foreach ($this->_container as $object) { |
|
23 | + if (is_object($object) && method_exists($object, $method_name)) { |
|
24 | 24 | call_user_func_array(array($object, $method_name), $arguments); |
25 | 25 | } |
26 | 26 | } |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function getSumProperty($property_name) { |
37 | 37 | $result = 0.0; |
38 | - foreach($this->_container as $object) { |
|
39 | - if(is_object($object) && property_exists($object, $property_name)) { |
|
38 | + foreach ($this->_container as $object) { |
|
39 | + if (is_object($object) && property_exists($object, $property_name)) { |
|
40 | 40 | $result += $object->$property_name; |
41 | 41 | } |
42 | 42 | } |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | 54 | public function aggregateByMethod($method_name, &$result) { |
55 | - foreach($this->_container as $object) { |
|
56 | - if(is_object($object) && method_exists($object, $method_name)) { |
|
55 | + foreach ($this->_container as $object) { |
|
56 | + if (is_object($object) && method_exists($object, $method_name)) { |
|
57 | 57 | call_user_func(array($object, $method_name), $result); |
58 | 58 | } |
59 | 59 | } |