summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
commita24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b (patch)
tree9194465a044c0fdad447eba2906f0472a4dff515 /includes
parenta5f42fd007bf3646261b431c52cde53657e21564 (diff)
downloadbrdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.gz
brdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.bz2
- Patch #471070 by stella: millions of code style fixes.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc4
-rw-r--r--includes/common.inc16
-rw-r--r--includes/database/pgsql/query.inc2
-rw-r--r--includes/database/query.inc2
-rw-r--r--includes/database/schema.inc2
-rw-r--r--includes/database/select.inc2
-rw-r--r--includes/file.inc6
-rw-r--r--includes/form.inc8
-rw-r--r--includes/install.inc14
-rw-r--r--includes/locale.inc4
-rw-r--r--includes/menu.inc4
-rw-r--r--includes/module.inc2
-rw-r--r--includes/theme.inc4
-rw-r--r--includes/unicode.inc4
14 files changed, 37 insertions, 37 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 590f1ba35..aa658cfbc 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -800,7 +800,7 @@ function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) {
* or NULL if the header has not been set.
*/
function drupal_get_header($name = NULL) {
- $headers = drupal_set_header();
+ $headers = drupal_set_header();
if (isset($name)) {
$name = strtolower($name);
return isset($headers[$name]) ? $headers[$name] : NULL;
@@ -1824,7 +1824,7 @@ function registry_rebuild() {
* @param $name
* Globally unique name for the variable. For a function with only one static,
* variable, the function name (e.g. via the PHP magic __FUNCTION__ constant)
- * is recommended. For a function with multiple static variables add a
+ * is recommended. For a function with multiple static variables add a
* distinguishing suffix to the function name for each one.
* @param $default_value
* Optional default value.
diff --git a/includes/common.inc b/includes/common.inc
index 7ef5a7deb..72b468560 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -385,7 +385,7 @@ function drupal_not_found() {
*/
function drupal_access_denied() {
drupal_set_header('403 Forbidden');
-
+
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
$path = drupal_get_normal_path(variable_get('site_403', ''));
@@ -741,8 +741,8 @@ function _drupal_decode_exception($exception) {
// or in one of its global functions.
$db_functions = array('db_query', 'pager_query', 'db_query_range', 'db_query_temporary', 'update_sql');
while (!empty($backtrace[1]) && ($caller = $backtrace[1]) &&
- ((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE)) ||
- in_array($caller['function'], $db_functions))) {
+ ((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE)) ||
+ in_array($caller['function'], $db_functions))) {
// We remove that call.
array_shift($backtrace);
}
@@ -2219,7 +2219,7 @@ function drupal_get_path($type, $name) {
/**
* Return the base URL path (i.e., directory) of the Drupal installation.
*
- * base_path() prefixes and suffixes a "/" onto the returned path if the path is
+ * base_path() prefixes and suffixes a "/" onto the returned path if the path is
* not empty. At the very least, this will return "/".
*
* Examples:
@@ -2571,7 +2571,7 @@ function drupal_load_stylesheet($file, $optimize = NULL) {
* @return
* Contents of the stylesheet including the imported stylesheets.
*/
-function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
+function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
// Replaces @import commands with the actual stylesheet content.
// This happens recursively but omits external files.
$contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents);
@@ -3134,8 +3134,8 @@ function drupal_json($var = NULL) {
function drupal_urlencode($text) {
if (variable_get('clean_url', '0')) {
return str_replace(array('%2F', '%26', '%23', '//'),
- array('/', '%2526', '%2523', '/%252F'),
- rawurlencode($text));
+ array('/', '%2526', '%2523', '/%252F'),
+ rawurlencode($text));
}
else {
return str_replace('%2F', '/', rawurlencode($text));
@@ -4274,7 +4274,7 @@ function drupal_write_record($table, &$object, $primary_keys = array()) {
if (empty($primary_keys)) {
$options = array('return' => Database::RETURN_INSERT_ID);
if (isset($serial) && isset($fields[$serial])) {
- // If the serial column has been explicitly set with an ID, then we don't
+ // If the serial column has been explicitly set with an ID, then we don't
// require the database to return the last insert id.
if ($fields[$serial]) {
$options['return'] = Database::RETURN_AFFECTED;
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc
index 39a132bdd..d17721221 100644
--- a/includes/database/pgsql/query.inc
+++ b/includes/database/pgsql/query.inc
@@ -25,7 +25,7 @@ class InsertQuery_pgsql extends InsertQuery {
if (count($this->insertFields) + count($this->defaultFields) == 0) {
return NULL;
}
-
+
// Don't execute query without values.
if (!isset($this->insertValues[0]) && count($this->insertFields) > 0) {
return NULL;
diff --git a/includes/database/query.inc b/includes/database/query.inc
index db0cd31ed..8d614a0dd 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -611,7 +611,7 @@ class MergeQuery extends Query {
* The called object.
*/
public function update(array $fields, array $values = array()) {
- if ($values) {
+ if ($values) {
$fields = array_combine($fields, $values);
}
$this->updateFields = $fields;
diff --git a/includes/database/schema.inc b/includes/database/schema.inc
index c1a0e6871..d6302e0c6 100644
--- a/includes/database/schema.inc
+++ b/includes/database/schema.inc
@@ -496,7 +496,7 @@ abstract class DatabaseSchema {
/**
* Prepare a table or column comment for database query.
- *
+ *
* @param $comment
* The comment string to prepare.
* @param $length
diff --git a/includes/database/select.inc b/includes/database/select.inc
index 74a66b954..65b31bc6c 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -1091,7 +1091,7 @@ class SelectQuery extends Query implements SelectQueryInterface {
// If the table is a subquery, compile it and integrate it into this query.
if ($table['table'] instanceof SelectQueryInterface) {
- $table_string = '(' . (string)$table['table'] .')';
+ $table_string = '(' . (string)$table['table'] . ')';
}
else {
$table_string = '{' . $this->connection->escapeTable($table['table']) . '}';
diff --git a/includes/file.inc b/includes/file.inc
index a8aaf9848..a9ff49e9d 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -916,7 +916,7 @@ function file_save_upload($source, $validators = array(), $destination = FALSE,
// Final check that this is a valid upload, if it isn't, use the
// default error handler.
if (is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
- break;
+ break;
}
// Unknown error
@@ -1401,7 +1401,7 @@ function file_download() {
* @return
* An associative array (keyed on the provided key) of objects with
* 'filepath', 'filename', and 'name' members corresponding to the
- * matching files.
+ * matching files.
*/
function file_scan_directory($dir, $mask, $options = array(), $depth = 0) {
// Merge in defaults.
@@ -1878,7 +1878,7 @@ function file_get_mimetype($filename, $mapping = NULL) {
));
}
foreach ($mapping as $ext_preg => $mime_match) {
- if (preg_match('!\.('. $ext_preg .')$!i', $filename)) {
+ if (preg_match('!\.(' . $ext_preg . ')$!i', $filename)) {
return $mime_match;
}
}
diff --git a/includes/form.inc b/includes/form.inc
index 83392a3f7..7a05010f1 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -29,7 +29,7 @@
* presentation, while simplifying code and reducing the amount of HTML that
* must be explicitly generated by modules.
*
- * The drupal_get_form() function handles retrieving and processing an HTML
+ * The drupal_get_form() function handles retrieving and processing an HTML
* form for modules automatically. For example:
*
* @code
@@ -198,7 +198,7 @@ function drupal_build_form($form_id, &$form_state) {
if ((!empty($form_state['storage']) || !empty($form_state['rebuild'])) && !empty($form_state['submitted']) && !form_get_errors()) {
$form = drupal_rebuild_form($form_id, $form_state);
}
-
+
// Don't override #theme if someone already set it.
if (!isset($form['#theme'])) {
init_theme();
@@ -823,8 +823,8 @@ function form_execute_handlers($type, &$form, &$form_state) {
foreach ($handlers as $function) {
if (drupal_function_exists($function)) {
- // Check to see if a previous _submit handler has set a batch, but
- // make sure we do not react to a batch that is already being processed
+ // Check to see if a previous _submit handler has set a batch, but
+ // make sure we do not react to a batch that is already being processed
// (for instance if a batch operation performs a drupal_form_submit()).
if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) {
// Some previous _submit handler has set a batch. We store the call
diff --git a/includes/install.inc b/includes/install.inc
index b3358f285..5f296477b 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -414,7 +414,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
function drupal_get_install_files($module_list = array()) {
$installs = array();
foreach ($module_list as $module) {
- $installs = array_merge($installs, drupal_system_listing('/'. $module . '.install$/', 'modules'));
+ $installs = array_merge($installs, drupal_system_listing('/' . $module . '.install$/', 'modules'));
}
return $installs;
}
@@ -628,11 +628,11 @@ function drupal_uninstall_modules($module_list = array()) {
$placeholders = implode(', ', array_fill(0, count($paths), "'%s'"));
$result = db_select('menu_links')
- ->fields('menu_links')
- ->condition('router_path', $paths, 'IN')
- ->condition('external', 0)
- ->orderBy('depth')
- ->execute();
+ ->fields('menu_links')
+ ->condition('router_path', $paths, 'IN')
+ ->condition('external', 0)
+ ->orderBy('depth')
+ ->execute();
// Remove all such items. Starting from those with the greatest depth will
// minimize the amount of re-parenting done by menu_link_delete().
foreach ($result as $item) {
@@ -938,7 +938,7 @@ function drupal_check_profile($profile) {
$requirements = array();
foreach ($installs as $install) {
require_once DRUPAL_ROOT . '/' . $install->filepath;
- $function = $install->name. '_requirements';
+ $function = $install->name . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
diff --git a/includes/locale.inc b/includes/locale.inc
index d94e09f24..5247a1b78 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -542,7 +542,7 @@ function locale_translate_overview_screen() {
// Languages with at least one record in the locale table.
$translations = db_query("SELECT COUNT(*) AS translation, t.language, s.textgroup FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY textgroup, language");
foreach ($translations as $data) {
- $ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup])*100., 2) : 0;
+ $ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup]) * 100.0, 2) : 0;
$rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)";
}
@@ -688,7 +688,7 @@ function locale_translation_filter_form_submit($form, &$form_state) {
$_SESSION['locale_translation_filter'] = array();
break;
}
-
+
$form_state['redirect'] = 'admin/international/translate/translate';
}
diff --git a/includes/menu.inc b/includes/menu.inc
index 9011b31c7..4bc5c7581 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1839,7 +1839,7 @@ function menu_router_build() {
// a given item came from.
$callbacks = array();
foreach (module_implements('menu') as $module) {
- $router_items = call_user_func($module .'_menu');
+ $router_items = call_user_func($module . '_menu');
if (isset($router_items) && is_array($router_items)) {
foreach (array_keys($router_items) as $path) {
$router_items[$path]['module'] = $module;
@@ -1860,7 +1860,7 @@ function menu_router_build() {
*/
function _menu_router_cache($new_menu = NULL) {
$menu = &drupal_static(__FUNCTION__);
-
+
if (isset($new_menu)) {
$menu = $new_menu;
}
diff --git a/includes/module.inc b/includes/module.inc
index 2e00088eb..aea3c8f96 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -157,7 +157,7 @@ function module_rebuild_cache() {
* without this module.
*/
function _module_build_dependencies($files) {
- require_once DRUPAL_ROOT .'/includes/graph.inc';
+ require_once DRUPAL_ROOT . '/includes/graph.inc';
$roots = $files;
foreach ($files as $filename => $file) {
$graph[$file->name]['edges'] = array();
diff --git a/includes/theme.inc b/includes/theme.inc
index 522c1db29..88ebb240a 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -895,7 +895,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array();
// Escape the periods in the extension.
- $regex = '/'. str_replace('.', '\.', $extension) . '$/';
+ $regex = '/' . str_replace('.', '\.', $extension) . '$/';
// Because drupal_system_listing works the way it does, we check for real
// templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0);
@@ -1373,7 +1373,7 @@ function theme_submenu($links) {
* within a table. For example, one may easily group three columns and
* apply same background style to all.
* @param $sticky
- * Use a "sticky" table header.
+ * Use a "sticky" table header.
* @return
* An HTML string representing the table.
*/
diff --git a/includes/unicode.inc b/includes/unicode.inc
index 8c2f64970..da4a37377 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -333,9 +333,9 @@ function decode_entities($text, $exclude = array()) {
// Flip the exclude list so that we can do quick lookups later.
$exclude = array_flip($exclude);
- // Use a regexp to select all entities in one pass, to avoid decoding
+ // Use a regexp to select all entities in one pass, to avoid decoding
// double-escaped entities twice. The PREG_REPLACE_EVAL modifier 'e' is
- // being used to allow for a callback (see
+ // being used to allow for a callback (see
// http://php.net/manual/en/reference.pcre.pattern.modifiers).
return preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities("$1", "$2", "$0", $html_entities, $exclude)', $text);
}