Skip to content

Commit

Permalink
Add missing space after foreach calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jul 21, 2011
1 parent bc0a10b commit 48e9af4
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// the db name
$procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
if ($procedure_names) {
foreach($procedure_names as $procedure_name) {
foreach ($procedure_names as $procedure_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name);
// collect for later display
Expand All @@ -89,7 +89,7 @@

$function_names = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($function_names) {
foreach($function_names as $function_name) {
foreach ($function_names as $function_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'FUNCTION', $function_name);
// collect for later display
Expand Down Expand Up @@ -234,7 +234,7 @@
// the db name
$event_names = PMA_DBI_fetch_result('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddSlashes($db,true) . '\';');
if ($event_names) {
foreach($event_names as $event_name) {
foreach ($event_names as $event_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'EVENT', $event_name);
// collect for later display
Expand Down
2 changes: 1 addition & 1 deletion enum_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
// Display the values in text fields, excluding empty strings
$field_counter = 0;
foreach($values as $value) {
foreach ($values as $value) {
if(trim($value) != "") {
$field_counter++;
echo sprintf('<input type="text" size="30" value="%s" name="field' . $field_counter . '" />', htmlspecialchars(str_replace(array("''", '\\\\', "\\'"), array("'", '\\', "'"), substr($value, 1, -1))));
Expand Down
4 changes: 2 additions & 2 deletions export.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function PMA_exportOutputHandler($line)
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
}

foreach($_REQUEST as $name => $value) {
foreach ($_REQUEST as $name => $value) {
$back_button .= '&' . urlencode($name) . '=' . urlencode($value);
}
$back_button .= '&repopulate=1">Back</a> ]</p>';
Expand Down Expand Up @@ -492,7 +492,7 @@ function PMA_exportOutputHandler($line)
}
}
}
foreach($views as $view) {
foreach ($views as $view) {
// no data export for a view
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/List_Database.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function getGroupedDetails($offset, $count)

$pos = false;

foreach($separators as $separator) {
foreach ($separators as $separator) {
// use strpos instead of strrpos; it seems more common to
// have the db name, the separator, then the rest which
// might contain a separator
Expand Down
4 changes: 2 additions & 2 deletions libraries/auth/cookie.auth.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function PMA_auth_check()
// END Swekey Integration

if (defined('PMA_CLEAR_COOKIES')) {
foreach($GLOBALS['cfg']['Servers'] as $key => $val) {
foreach ($GLOBALS['cfg']['Servers'] as $key => $val) {
$GLOBALS['PMA_Config']->removeCookie('pmaPass-' . $key);
$GLOBALS['PMA_Config']->removeCookie('pmaServer-' . $key);
$GLOBALS['PMA_Config']->removeCookie('pmaUser-' . $key);
Expand All @@ -352,7 +352,7 @@ function PMA_auth_check()
session_destroy();
// -> delete password cookie(s)
if ($GLOBALS['cfg']['LoginCookieDeleteAll']) {
foreach($GLOBALS['cfg']['Servers'] as $key => $val) {
foreach ($GLOBALS['cfg']['Servers'] as $key => $val) {
$GLOBALS['PMA_Config']->removeCookie('pmaPass-' . $key);
if (isset($_COOKIE['pmaPass-' . $key])) {
unset($_COOKIE['pmaPass-' . $key]);
Expand Down
2 changes: 1 addition & 1 deletion libraries/bookmark.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function PMA_Bookmark_getList($db)
. ' ORDER BY label';
$global = PMA_DBI_fetch_result($query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE);

foreach($global as $key => $val) {
foreach ($global as $key => $val) {
$global[$key] = $val . ' (' . __('shared') . ')';
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/cleanup.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function PMA_remove_request_vars(&$whitelist)
// strings
$keys = array_keys(array_merge((array)$_REQUEST, (array)$_GET, (array)$_POST, (array)$_COOKIE));

foreach($keys as $key) {
foreach ($keys as $key) {
if (! in_array($key, $whitelist)) {
unset($_REQUEST[$key], $_GET[$key], $_POST[$key], $GLOBALS[$key]);
} else {
Expand Down
4 changes: 2 additions & 2 deletions libraries/common.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
/**
* just to be sure there was no import (registering) before here
* we empty the global space (but avoid unsetting $variables_list
* and $key in the foreach(), we still need them!)
* and $key in the foreach (), we still need them!)
*/
$variables_whitelist = array (
'GLOBALS',
Expand Down Expand Up @@ -313,7 +313,7 @@
&& (isset($_COOKIE['pmaCookieVer'])
&& $_COOKIE['pmaCookieVer'] < $pma_cookie_version)) {
// delete all cookies
foreach($_COOKIE as $cookie_name => $tmp) {
foreach ($_COOKIE as $cookie_name => $tmp) {
$GLOBALS['PMA_Config']->removeCookie($cookie_name);
}
$_COOKIE = array();
Expand Down
4 changes: 2 additions & 2 deletions libraries/common.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2749,7 +2749,7 @@ function PMA_expandUserString($string, $escape = null, $updates = array()) {
$vars['phpmyadmin_version'] = 'phpMyAdmin ' . PMA_VERSION;

/* Update forced variables */
foreach($updates as $key => $val) {
foreach ($updates as $key => $val) {
$vars[$key] = $val;
}

Expand All @@ -2773,7 +2773,7 @@ function PMA_expandUserString($string, $escape = null, $updates = array()) {

/* Optional escaping */
if (!is_null($escape)) {
foreach($replace as $key => $val) {
foreach ($replace as $key => $val) {
$replace[$key] = $escape($val);
}
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/database_interface.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = fals
unset($sql_where_table, $sql);
if ($sort_by == 'Name' && $GLOBALS['cfg']['NaturalOrder']) {
// here, the array's first key is by schema name
foreach($tables as $one_database_name => $one_database_tables) {
foreach ($tables as $one_database_name => $one_database_tables) {
uksort($one_database_tables, 'strnatcasecmp');

if ($sort_order == 'DESC') {
Expand Down Expand Up @@ -494,7 +494,7 @@ function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = fals
// Note 2: Instead of array_merge(), simply use the + operator because
// array_merge() renumbers numeric keys starting with 0, therefore
// we would lose a db name thats consists only of numbers
foreach($tables as $one_database => $its_tables) {
foreach ($tables as $one_database => $its_tables) {
if (isset(PMA_Table::$cache[$one_database])) {
PMA_Table::$cache[$one_database] = PMA_Table::$cache[$one_database] + $tables[$one_database];
} else {
Expand Down Expand Up @@ -1341,7 +1341,7 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//')

// Sort results by name
$name = array();
foreach($result as $key => $value) {
foreach ($result as $key => $value) {
$name[] = $value['name'];
}
array_multisort($name, SORT_ASC, $result);
Expand Down
2 changes: 1 addition & 1 deletion libraries/display_tbl.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// find the sorted column index in row result
// (this might be a multi-table query)
$sorted_column_index = false;
foreach($fields_meta as $key => $meta) {
foreach ($fields_meta as $key => $meta) {
if ($meta->table == $sort_table && $meta->name == $sort_column) {
$sorted_column_index = $key;
break;
Expand Down
12 changes: 6 additions & 6 deletions libraries/export/sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$compats = PMA_DBI_getCompatibilities();
if (count($compats) > 0) {
$values = array();
foreach($compats as $val) {
foreach ($compats as $val) {
$values[$val] = $val;
}
$plugin_list['sql']['options'][] = array(
Expand Down Expand Up @@ -322,7 +322,7 @@ function PMA_exportRoutines($db) {
. PMA_exportComment(__('Procedures'))
. PMA_exportComment();

foreach($procedure_names as $procedure_name) {
foreach ($procedure_names as $procedure_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf;
}
Expand All @@ -336,7 +336,7 @@ function PMA_exportRoutines($db) {
. PMA_exportComment(__('Functions'))
. PMA_exportComment();

foreach($function_names as $function_name) {
foreach ($function_names as $function_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf;
}
Expand Down Expand Up @@ -469,7 +469,7 @@ function PMA_exportHeader()
// backslash and n, as explained on the export interface
$lines = explode('\n', $GLOBALS['sql_header_comment']);
$head .= PMA_exportComment();
foreach($lines as $one_line) {
foreach ($lines as $one_line) {
$head .= PMA_exportComment($one_line);
}
$head .= PMA_exportComment();
Expand Down Expand Up @@ -609,7 +609,7 @@ function PMA_exportDBFooter($db)
. PMA_exportComment(__('Events'))
. PMA_exportComment();

foreach($event_names as $event_name) {
foreach ($event_names as $event_name) {
if (! empty($GLOBALS['sql_drop_table'])) {
$text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf;
}
Expand Down Expand Up @@ -650,7 +650,7 @@ function PMA_getTableDefStandIn($db, $view, $crlf) {
$create_query .= PMA_backquote($view) . ' (' . $crlf;
$tmp = array();
$columns = PMA_DBI_get_columns_full($db, $view);
foreach($columns as $column_name => $definition) {
foreach ($columns as $column_name => $definition) {
$tmp[] = PMA_backquote($column_name) . ' ' . $definition['Type'] . $crlf;
}
$create_query .= implode(',', $tmp) . ');';
Expand Down
2 changes: 1 addition & 1 deletion libraries/import/sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$compats = PMA_DBI_getCompatibilities();
if (count($compats) > 0) {
$values = array();
foreach($compats as $val) {
foreach ($compats as $val) {
$values[$val] = $val;
}
$plugin_list['sql']['options'] = array(
Expand Down
2 changes: 1 addition & 1 deletion libraries/import/xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
$create = array();

foreach ($struct as $tier1 => $val1) {
foreach($val1 as $tier2 => $val2) {
foreach ($val1 as $tier2 => $val2) {
/* Need to select the correct database for the creation of tables, views, triggers, etc. */
/**
* @todo Generating a USE here blocks importing of a table
Expand Down
6 changes: 3 additions & 3 deletions libraries/plugin_interface.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function PMA_pluginGetDefault($section, $opt)
/* Possibly replace localised texts */
if (preg_match_all('/(str[A-Z][A-Za-z0-9]*)/', $GLOBALS['cfg'][$section][$opt], $matches)) {
$val = $GLOBALS['cfg'][$section][$opt];
foreach($matches[0] as $match) {
foreach ($matches[0] as $match) {
if (isset($GLOBALS[$match])) {
$val = str_replace($match, $GLOBALS[$match], $val);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' id="select_' . $plugin_name . '_' . $opt['name'] . '">';
$default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']);
foreach($opt['values'] as $key => $val) {
foreach ($opt['values'] as $key => $val) {
$ret .= '<option value="' . $key . '"';
if ($key == $default) {
$ret .= ' selected="selected"';
Expand All @@ -227,7 +227,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= '</select>';
} elseif ($opt['type'] == 'radio') {
$default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']);
foreach($opt['values'] as $key => $val) {
foreach ($opt['values'] as $key => $val) {
$ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $opt['name'] . '" value="' . $key
. '" id="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '"';
if($key == $default) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/schema/User_Schema.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ public function processRelations($db, $pageNumber, $cfgRelation, $query_default_
*/
$tables = PMA_DBI_get_tables_full($db);
$foreignkey_tables = array();
foreach($tables as $table_name => $table_properties) {
foreach ($tables as $table_name => $table_properties) {
if (PMA_foreignkey_supported($table_properties['ENGINE'])) {
$foreignkey_tables[] = $table_name;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/server_synchronize.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom
while ($one_row = PMA_DBI_fetch_row($unbuffered_result)) {
$insert_query .= '(';
$key_of_last_value = count($one_row) - 1;
foreach($one_row as $key => $value) {
foreach ($one_row as $key => $value) {
$insert_query .= "'" . PMA_sqlAddSlashes($value) . "'";
if ($key < $key_of_last_value) {
$insert_query .= ",";
Expand Down
2 changes: 1 addition & 1 deletion libraries/sysinfo.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function memory() {
$mem['MemUsed'] = $mem['MemTotal'] - $mem['MemFree'] - $mem['Cached'] - $mem['Buffers'];
$mem['SwapUsed'] = $mem['SwapTotal'] - $mem['SwapFree'] - $mem['SwapCached'];

foreach($mem as $idx=>$value)
foreach ($mem as $idx=>$value)
$mem[$idx] = intval($value);

return $mem;
Expand Down
22 changes: 11 additions & 11 deletions libraries/tcpdf/tcpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8437,7 +8437,7 @@ protected function _putpages() {
//Pages root
$out = $this->_getobj(1)."\n";
$out .= '<< /Type /Pages /Kids [';
foreach($this->page_obj_id as $page_obj) {
foreach ($this->page_obj_id as $page_obj) {
$out .= ' '.$page_obj.' 0 R';
}
$out .= ' ] /Count '.$nb.' >>';
Expand Down Expand Up @@ -8902,7 +8902,7 @@ protected function _putannotsobjs() {
}
if (isset($pl['opt']['mk']['bc']) AND (is_array($pl['opt']['mk']['bc']))) {
$annots .= ' /BC [';
foreach($pl['opt']['mk']['bc'] AS $col) {
foreach ($pl['opt']['mk']['bc'] AS $col) {
$col = intval($col);
$color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255);
$annots .= sprintf(' %.2F', $color);
Expand All @@ -8911,7 +8911,7 @@ protected function _putannotsobjs() {
}
if (isset($pl['opt']['mk']['bg']) AND (is_array($pl['opt']['mk']['bg']))) {
$annots .= ' /BG [';
foreach($pl['opt']['mk']['bg'] AS $col) {
foreach ($pl['opt']['mk']['bg'] AS $col) {
$col = intval($col);
$color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255);
$annots .= sprintf(' %.2F', $color);
Expand Down Expand Up @@ -8988,7 +8988,7 @@ protected function _putannotsobjs() {
if (is_array($pl['opt']['ff'])) {
// array of bit settings
$flag = 0;
foreach($pl['opt']['ff'] as $val) {
foreach ($pl['opt']['ff'] as $val) {
$flag += 1 << ($val - 1);
}
} else {
Expand Down Expand Up @@ -9052,7 +9052,7 @@ protected function _putannotsobjs() {
}
if (isset($pl['opt']['opt']) AND (is_array($pl['opt']['opt'])) AND !empty($pl['opt']['opt'])) {
$annots .= ' /Opt [';
foreach($pl['opt']['opt'] AS $copt) {
foreach ($pl['opt']['opt'] AS $copt) {
if (is_array($copt)) {
$annots .= ' ['.$this->_textstring($copt[0], $annot_obj_id).' '.$this->_textstring($copt[1], $annot_obj_id).']';
} else {
Expand All @@ -9066,7 +9066,7 @@ protected function _putannotsobjs() {
}
if (isset($pl['opt']['i']) AND (is_array($pl['opt']['i'])) AND !empty($pl['opt']['i'])) {
$annots .= ' /I [';
foreach($pl['opt']['i'] AS $copt) {
foreach ($pl['opt']['i'] AS $copt) {
$annots .= intval($copt).' ';
}
$annots .= ']';
Expand Down Expand Up @@ -10595,7 +10595,7 @@ protected function _putcatalog() {
$objrefs .= $this->sig_obj_id.' 0 R';
}
if (!empty($this->form_obj_id)) {
foreach($this->form_obj_id as $objid) {
foreach ($this->form_obj_id as $objid) {
$objrefs .= ' '.$objid.' 0 R';
}
}
Expand Down Expand Up @@ -17875,7 +17875,7 @@ protected function isValidCSSSelectorForTag($dom, $key, $selector) {
protected function getTagStyleFromCSS($dom, $key, $css) {
$tagstyle = ''; // style to be returned
// get all styles that apply
foreach($css as $selector => $style) {
foreach ($css as $selector => $style) {
// remove specificity
$selector = substr($selector, strpos($selector, ' '));
// check if this selector apply to current tag
Expand Down Expand Up @@ -23789,7 +23789,7 @@ public function getHyphenPatternsFromTEX($file) {
$patterns_array = preg_split('/[\s]+/', $data);
// create new language array of patterns
$patterns = array();
foreach($patterns_array as $val) {
foreach ($patterns_array as $val) {
if (!$this->empty_string($val)) {
$val = trim($val);
$val = str_replace('\'', '\\\'', $val);
Expand Down Expand Up @@ -25077,12 +25077,12 @@ protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1
$gradient['coords'][4] /= $w;
}
} elseif ($gradient['mode'] == 'percentage') {
foreach($gradient['coords'] as $key => $val) {
foreach ($gradient['coords'] as $key => $val) {
$gradient['coords'][$key] = (intval($val) / 100);
}
}
// fix values
foreach($gradient['coords'] as $key => $val) {
foreach ($gradient['coords'] as $key => $val) {
if ($val < 0) {
$gradient['coords'][$key] = 0;
} elseif ($val > 1) {
Expand Down
Loading

0 comments on commit 48e9af4

Please sign in to comment.