Commit a24a6c2b authored by Dries's avatar Dries

- Patch #471070 by stella: millions of code style fixes.

parent a5f42fd0
...@@ -800,7 +800,7 @@ function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) { ...@@ -800,7 +800,7 @@ function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) {
* or NULL if the header has not been set. * or NULL if the header has not been set.
*/ */
function drupal_get_header($name = NULL) { function drupal_get_header($name = NULL) {
$headers = drupal_set_header(); $headers = drupal_set_header();
if (isset($name)) { if (isset($name)) {
$name = strtolower($name); $name = strtolower($name);
return isset($headers[$name]) ? $headers[$name] : NULL; return isset($headers[$name]) ? $headers[$name] : NULL;
...@@ -1824,7 +1824,7 @@ function registry_rebuild() { ...@@ -1824,7 +1824,7 @@ function registry_rebuild() {
* @param $name * @param $name
* Globally unique name for the variable. For a function with only one static, * 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) * 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. * distinguishing suffix to the function name for each one.
* @param $default_value * @param $default_value
* Optional default value. * Optional default value.
......
...@@ -385,7 +385,7 @@ function drupal_not_found() { ...@@ -385,7 +385,7 @@ function drupal_not_found() {
*/ */
function drupal_access_denied() { function drupal_access_denied() {
drupal_set_header('403 Forbidden'); drupal_set_header('403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
$path = drupal_get_normal_path(variable_get('site_403', '')); $path = drupal_get_normal_path(variable_get('site_403', ''));
...@@ -741,8 +741,8 @@ function _drupal_decode_exception($exception) { ...@@ -741,8 +741,8 @@ function _drupal_decode_exception($exception) {
// or in one of its global functions. // or in one of its global functions.
$db_functions = array('db_query', 'pager_query', 'db_query_range', 'db_query_temporary', 'update_sql'); $db_functions = array('db_query', 'pager_query', 'db_query_range', 'db_query_temporary', 'update_sql');
while (!empty($backtrace[1]) && ($caller = $backtrace[1]) && while (!empty($backtrace[1]) && ($caller = $backtrace[1]) &&
((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE)) || ((isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE)) ||
in_array($caller['function'], $db_functions))) { in_array($caller['function'], $db_functions))) {
// We remove that call. // We remove that call.
array_shift($backtrace); array_shift($backtrace);
} }
...@@ -2219,7 +2219,7 @@ function drupal_get_path($type, $name) { ...@@ -2219,7 +2219,7 @@ function drupal_get_path($type, $name) {
/** /**
* Return the base URL path (i.e., directory) of the Drupal installation. * 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 "/". * not empty. At the very least, this will return "/".
* *
* Examples: * Examples:
...@@ -2571,7 +2571,7 @@ function drupal_load_stylesheet($file, $optimize = NULL) { ...@@ -2571,7 +2571,7 @@ function drupal_load_stylesheet($file, $optimize = NULL) {
* @return * @return
* Contents of the stylesheet including the imported stylesheets. * 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. // Replaces @import commands with the actual stylesheet content.
// This happens recursively but omits external files. // This happens recursively but omits external files.
$contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents); $contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_drupal_load_stylesheet', $contents);
...@@ -3134,8 +3134,8 @@ function drupal_json($var = NULL) { ...@@ -3134,8 +3134,8 @@ function drupal_json($var = NULL) {
function drupal_urlencode($text) { function drupal_urlencode($text) {
if (variable_get('clean_url', '0')) { if (variable_get('clean_url', '0')) {
return str_replace(array('%2F', '%26', '%23', '//'), return str_replace(array('%2F', '%26', '%23', '//'),
array('/', '%2526', '%2523', '/%252F'), array('/', '%2526', '%2523', '/%252F'),
rawurlencode($text)); rawurlencode($text));
} }
else { else {
return str_replace('%2F', '/', rawurlencode($text)); return str_replace('%2F', '/', rawurlencode($text));
...@@ -4274,7 +4274,7 @@ function drupal_write_record($table, &$object, $primary_keys = array()) { ...@@ -4274,7 +4274,7 @@ function drupal_write_record($table, &$object, $primary_keys = array()) {
if (empty($primary_keys)) { if (empty($primary_keys)) {
$options = array('return' => Database::RETURN_INSERT_ID); $options = array('return' => Database::RETURN_INSERT_ID);
if (isset($serial) && isset($fields[$serial])) { 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. // require the database to return the last insert id.
if ($fields[$serial]) { if ($fields[$serial]) {
$options['return'] = Database::RETURN_AFFECTED; $options['return'] = Database::RETURN_AFFECTED;
......
...@@ -25,7 +25,7 @@ public function execute() { ...@@ -25,7 +25,7 @@ public function execute() {
if (count($this->insertFields) + count($this->defaultFields) == 0) { if (count($this->insertFields) + count($this->defaultFields) == 0) {
return NULL; return NULL;
} }
// Don't execute query without values. // Don't execute query without values.
if (!isset($this->insertValues[0]) && count($this->insertFields) > 0) { if (!isset($this->insertValues[0]) && count($this->insertFields) > 0) {
return NULL; return NULL;
......
...@@ -611,7 +611,7 @@ public function key(array $fields, array $values = array()) { ...@@ -611,7 +611,7 @@ public function key(array $fields, array $values = array()) {
* The called object. * The called object.
*/ */
public function update(array $fields, array $values = array()) { public function update(array $fields, array $values = array()) {
if ($values) { if ($values) {
$fields = array_combine($fields, $values); $fields = array_combine($fields, $values);
} }
$this->updateFields = $fields; $this->updateFields = $fields;
......
...@@ -496,7 +496,7 @@ public function fieldNames($fields) { ...@@ -496,7 +496,7 @@ public function fieldNames($fields) {
/** /**
* Prepare a table or column comment for database query. * Prepare a table or column comment for database query.
* *
* @param $comment * @param $comment
* The comment string to prepare. * The comment string to prepare.
* @param $length * @param $length
......
...@@ -1091,7 +1091,7 @@ public function __toString() { ...@@ -1091,7 +1091,7 @@ public function __toString() {
// If the table is a subquery, compile it and integrate it into this query. // If the table is a subquery, compile it and integrate it into this query.
if ($table['table'] instanceof SelectQueryInterface) { if ($table['table'] instanceof SelectQueryInterface) {
$table_string = '(' . (string)$table['table'] .')'; $table_string = '(' . (string)$table['table'] . ')';
} }
else { else {
$table_string = '{' . $this->connection->escapeTable($table['table']) . '}'; $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';
......
...@@ -916,7 +916,7 @@ function file_save_upload($source, $validators = array(), $destination = FALSE, ...@@ -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 // Final check that this is a valid upload, if it isn't, use the
// default error handler. // default error handler.
if (is_uploaded_file($_FILES['files']['tmp_name'][$source])) { if (is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
break; break;
} }
// Unknown error // Unknown error
...@@ -1401,7 +1401,7 @@ function file_download() { ...@@ -1401,7 +1401,7 @@ function file_download() {
* @return * @return
* An associative array (keyed on the provided key) of objects with * An associative array (keyed on the provided key) of objects with
* 'filepath', 'filename', and 'name' members corresponding to the * 'filepath', 'filename', and 'name' members corresponding to the
* matching files. * matching files.
*/ */
function file_scan_directory($dir, $mask, $options = array(), $depth = 0) { function file_scan_directory($dir, $mask, $options = array(), $depth = 0) {
// Merge in defaults. // Merge in defaults.
...@@ -1878,7 +1878,7 @@ function file_get_mimetype($filename, $mapping = NULL) { ...@@ -1878,7 +1878,7 @@ function file_get_mimetype($filename, $mapping = NULL) {
)); ));
} }
foreach ($mapping as $ext_preg => $mime_match) { foreach ($mapping as $ext_preg => $mime_match) {
if (preg_match('!\.('. $ext_preg .')$!i', $filename)) { if (preg_match('!\.(' . $ext_preg . ')$!i', $filename)) {
return $mime_match; return $mime_match;
} }
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* presentation, while simplifying code and reducing the amount of HTML that * presentation, while simplifying code and reducing the amount of HTML that
* must be explicitly generated by modules. * 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: * form for modules automatically. For example:
* *
* @code * @code
...@@ -198,7 +198,7 @@ function drupal_build_form($form_id, &$form_state) { ...@@ -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()) { if ((!empty($form_state['storage']) || !empty($form_state['rebuild'])) && !empty($form_state['submitted']) && !form_get_errors()) {
$form = drupal_rebuild_form($form_id, $form_state); $form = drupal_rebuild_form($form_id, $form_state);
} }
// Don't override #theme if someone already set it. // Don't override #theme if someone already set it.
if (!isset($form['#theme'])) { if (!isset($form['#theme'])) {
init_theme(); init_theme();
...@@ -823,8 +823,8 @@ function form_execute_handlers($type, &$form, &$form_state) { ...@@ -823,8 +823,8 @@ function form_execute_handlers($type, &$form, &$form_state) {
foreach ($handlers as $function) { foreach ($handlers as $function) {
if (drupal_function_exists($function)) { if (drupal_function_exists($function)) {
// Check to see if a previous _submit handler has set a batch, but // 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 // 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()). // (for instance if a batch operation performs a drupal_form_submit()).
if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) { if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) {
// Some previous _submit handler has set a batch. We store the call // Some previous _submit handler has set a batch. We store the call
......
...@@ -414,7 +414,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') { ...@@ -414,7 +414,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
function drupal_get_install_files($module_list = array()) { function drupal_get_install_files($module_list = array()) {
$installs = array(); $installs = array();
foreach ($module_list as $module) { 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; return $installs;
} }
...@@ -628,11 +628,11 @@ function drupal_uninstall_modules($module_list = array()) { ...@@ -628,11 +628,11 @@ function drupal_uninstall_modules($module_list = array()) {
$placeholders = implode(', ', array_fill(0, count($paths), "'%s'")); $placeholders = implode(', ', array_fill(0, count($paths), "'%s'"));
$result = db_select('menu_links') $result = db_select('menu_links')
->fields('menu_links') ->fields('menu_links')
->condition('router_path', $paths, 'IN') ->condition('router_path', $paths, 'IN')
->condition('external', 0) ->condition('external', 0)
->orderBy('depth') ->orderBy('depth')
->execute(); ->execute();
// Remove all such items. Starting from those with the greatest depth will // Remove all such items. Starting from those with the greatest depth will
// minimize the amount of re-parenting done by menu_link_delete(). // minimize the amount of re-parenting done by menu_link_delete().
foreach ($result as $item) { foreach ($result as $item) {
...@@ -938,7 +938,7 @@ function drupal_check_profile($profile) { ...@@ -938,7 +938,7 @@ function drupal_check_profile($profile) {
$requirements = array(); $requirements = array();
foreach ($installs as $install) { foreach ($installs as $install) {
require_once DRUPAL_ROOT . '/' . $install->filepath; require_once DRUPAL_ROOT . '/' . $install->filepath;
$function = $install->name. '_requirements'; $function = $install->name . '_requirements';
if (function_exists($function)) { if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install')); $requirements = array_merge($requirements, $function('install'));
} }
......
...@@ -542,7 +542,7 @@ function locale_translate_overview_screen() { ...@@ -542,7 +542,7 @@ function locale_translate_overview_screen() {
// Languages with at least one record in the locale table. // 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"); $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) { 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%)"; $rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)";
} }
...@@ -688,7 +688,7 @@ function locale_translation_filter_form_submit($form, &$form_state) { ...@@ -688,7 +688,7 @@ function locale_translation_filter_form_submit($form, &$form_state) {
$_SESSION['locale_translation_filter'] = array(); $_SESSION['locale_translation_filter'] = array();
break; break;
} }
$form_state['redirect'] = 'admin/international/translate/translate'; $form_state['redirect'] = 'admin/international/translate/translate';
} }
......
...@@ -1839,7 +1839,7 @@ function menu_router_build() { ...@@ -1839,7 +1839,7 @@ function menu_router_build() {
// a given item came from. // a given item came from.
$callbacks = array(); $callbacks = array();
foreach (module_implements('menu') as $module) { 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)) { if (isset($router_items) && is_array($router_items)) {
foreach (array_keys($router_items) as $path) { foreach (array_keys($router_items) as $path) {
$router_items[$path]['module'] = $module; $router_items[$path]['module'] = $module;
...@@ -1860,7 +1860,7 @@ function menu_router_build() { ...@@ -1860,7 +1860,7 @@ function menu_router_build() {
*/ */
function _menu_router_cache($new_menu = NULL) { function _menu_router_cache($new_menu = NULL) {
$menu = &drupal_static(__FUNCTION__); $menu = &drupal_static(__FUNCTION__);
if (isset($new_menu)) { if (isset($new_menu)) {
$menu = $new_menu; $menu = $new_menu;
} }
......
...@@ -157,7 +157,7 @@ function module_rebuild_cache() { ...@@ -157,7 +157,7 @@ function module_rebuild_cache() {
* without this module. * without this module.
*/ */
function _module_build_dependencies($files) { function _module_build_dependencies($files) {
require_once DRUPAL_ROOT .'/includes/graph.inc'; require_once DRUPAL_ROOT . '/includes/graph.inc';
$roots = $files; $roots = $files;
foreach ($files as $filename => $file) { foreach ($files as $filename => $file) {
$graph[$file->name]['edges'] = array(); $graph[$file->name]['edges'] = array();
......
...@@ -895,7 +895,7 @@ function drupal_find_theme_templates($cache, $extension, $path) { ...@@ -895,7 +895,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array(); $subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array();
// Escape the periods in the extension. // 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 // Because drupal_system_listing works the way it does, we check for real
// templates separately from checking for patterns. // templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0); $files = drupal_system_listing($regex, $path, 'name', 0);
...@@ -1373,7 +1373,7 @@ function theme_submenu($links) { ...@@ -1373,7 +1373,7 @@ function theme_submenu($links) {
* within a table. For example, one may easily group three columns and * within a table. For example, one may easily group three columns and
* apply same background style to all. * apply same background style to all.
* @param $sticky * @param $sticky
* Use a "sticky" table header. * Use a "sticky" table header.
* @return * @return
* An HTML string representing the table. * An HTML string representing the table.
*/ */
......
...@@ -333,9 +333,9 @@ function decode_entities($text, $exclude = array()) { ...@@ -333,9 +333,9 @@ function decode_entities($text, $exclude = array()) {
// Flip the exclude list so that we can do quick lookups later. // Flip the exclude list so that we can do quick lookups later.
$exclude = array_flip($exclude); $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 // 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). // 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); return preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities("$1", "$2", "$0", $html_entities, $exclude)', $text);
} }
......
...@@ -559,7 +559,7 @@ function install_select_locale($profilename) { ...@@ -559,7 +559,7 @@ function install_select_locale($profilename) {
install_task_list('locale-select'); install_task_list('locale-select');
drupal_set_title(st('Choose language')); drupal_set_title(st('Choose language'));
print theme('install_page', drupal_render(drupal_get_form('install_select_locale_form', $locales))); print theme('install_page', drupal_render(drupal_get_form('install_select_locale_form', $locales)));
exit; exit;
} }
...@@ -665,7 +665,7 @@ function install_tasks($profile, $task) { ...@@ -665,7 +665,7 @@ function install_tasks($profile, $task) {
// to the same address, until the batch finished callback is invoked // to the same address, until the batch finished callback is invoked
// and the task advances to 'locale-initial-import'. // and the task advances to 'locale-initial-import'.
if ($task == 'profile-install-batch') { if ($task == 'profile-install-batch') {
include_once DRUPAL_ROOT .'/includes/batch.inc'; include_once DRUPAL_ROOT . '/includes/batch.inc';
$output = _batch_page(); $output = _batch_page();
} }
...@@ -917,7 +917,7 @@ function install_check_requirements($profile, $verify) { ...@@ -917,7 +917,7 @@ function install_check_requirements($profile, $verify) {
'title' => st('Settings file'), 'title' => st('Settings file'),
'value' => st('The settings file does not exist.'), 'value' => st('The settings file does not exist.'),
'severity' => REQUIREMENT_ERROR, 'severity' => REQUIREMENT_ERROR,
'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path .'/default.settings.php', '@install_txt' => base_path() .'INSTALL.txt')), 'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@install_txt' => base_path() . 'INSTALL.txt')),
); );
} }
else { else {
......
...@@ -55,7 +55,7 @@ function aggregator_view() { ...@@ -55,7 +55,7 @@ function aggregator_view() {
function aggregator_form_feed(&$form_state, stdClass $feed = NULL) { function aggregator_form_feed(&$form_state, stdClass $feed = NULL) {
$period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
$period[0] = t('Never'); $period[0] = t('Never');
$form['title'] = array('#type' => 'textfield', $form['title'] = array('#type' => 'textfield',
'#title' => t('Title'), '#title' => t('Title'),
'#default_value' => isset($feed->title) ? $feed->title : '', '#default_value' => isset($feed->title) ? $feed->title : '',
...@@ -458,7 +458,7 @@ function aggregator_admin_form($form_state) { ...@@ -458,7 +458,7 @@ function aggregator_admin_form($form_state) {
'#default_value' => variable_get('aggregator_processors', array('aggregator')), '#default_value' => variable_get('aggregator_processors', array('aggregator')),
); );
} }
if (count($basic_conf)) { if (count($basic_conf)) {
$form['basic_conf'] = array( $form['basic_conf'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => t('Basic configuration'), '#title' => t('Basic configuration'),
......
...@@ -109,8 +109,8 @@ function hook_aggregator_parse($feed) { ...@@ -109,8 +109,8 @@ function hook_aggregator_parse($feed) {
* parser. * parser.
* *
* The title and the description provided are shown on admin/settings/aggregator * The title and the description provided are shown on admin/settings/aggregator
* among other places. Use as title the human readable name of the parser and * among other places. Use as title the human readable name of the parser and
* as description a brief (40 to 80 characters) explanation of the parser's * as description a brief (40 to 80 characters) explanation of the parser's
* functionality. * functionality.
* *
* This hook is only called if your module implements hook_aggregator_parse(). * This hook is only called if your module implements hook_aggregator_parse().
...@@ -167,8 +167,8 @@ function hook_aggregator_process($feed) { ...@@ -167,8 +167,8 @@ function hook_aggregator_process($feed) {
* processor. * processor.
* *
* The title and the description provided are shown most importantly on * The title and the description provided are shown most importantly on
* admin/settings/aggregator. Use as title the natural name of the processor * admin/settings/aggregator. Use as title the natural name of the processor
* and as description a brief (40 to 80 characters) explanation of the * and as description a brief (40 to 80 characters) explanation of the
* functionality. * functionality.
* *
* This hook is only called if your module implements * This hook is only called if your module implements
......
...@@ -175,7 +175,7 @@ function aggregator_expire($feed) { ...@@ -175,7 +175,7 @@ function aggregator_expire($feed) {
// Remove all items that are older than flush item timer. // Remove all items that are older than flush item timer.
$age = REQUEST_TIME - $aggregator_clear; $age = REQUEST_TIME - $aggregator_clear;
$iids = db_query('SELECT iid FROM {aggregator_item} WHERE fid = :fid AND timestamp < :timestamp', array( $iids = db_query('SELECT iid FROM {aggregator_item} WHERE fid = :fid AND timestamp < :timestamp', array(
':fid' => $feed->fid, ':fid' => $feed->fid,
':timestamp' => $age, ':timestamp' => $age,
)) ))
->fetchCol(); ->fetchCol();
......
...@@ -20,7 +20,7 @@ class AggregatorTestCase extends DrupalWebTestCase { ...@@ -20,7 +20,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
* If given, feed will be created with this URL, otherwise /rss.xml will be used. * If given, feed will be created with this URL, otherwise /rss.xml will be used.
* @return $feed * @return $feed
* Full feed object if possible. * Full feed object if possible.
* *
* @see getFeedEditArray() * @see getFeedEditArray()
*/ */
function createFeed($feed_url = NULL) { function createFeed($feed_url = NULL) {
...@@ -67,8 +67,8 @@ class AggregatorTestCase extends DrupalWebTestCase { ...@@ -67,8 +67,8 @@ class AggregatorTestCase extends DrupalWebTestCase {
/** /**
* Return the count of the randomly created feed array. * Return the count of the randomly created feed array.
* *
* @return * @return
* Number of feed items on default feed created by createFeed(). * Number of feed items on default feed created by createFeed().
*/ */
function getDefaultFeedItemCount() { function getDefaultFeedItemCount() {
...@@ -117,10 +117,10 @@ class AggregatorTestCase extends DrupalWebTestCase { ...@@ -117,10 +117,10 @@ class AggregatorTestCase extends DrupalWebTestCase {
/** /**
* Add and remove feed items and ensure that the count is zero. * Add and remove feed items and ensure that the count is zero.
* *
* @param $feed * @param $feed
* Feed object representing the feed. * Feed object representing the feed.
* @param $expected_count * @param $expected_count
* Expected number of feed items. * Expected number of feed items.
*/ */
function updateAndRemove($feed, $expected_count) { function updateAndRemove($feed, $expected_count) {
...@@ -242,7 +242,7 @@ EOF; ...@@ -242,7 +242,7 @@ EOF;
function createSampleNodes() { function createSampleNodes() {
// Post 5 articles. // Post 5 articles.
for($i = 0; $i < 5; $i++) { for ($i = 0; $i < 5; $i++) {
$edit = array(); $edit = array();
$edit['title'] = $this->randomName(); $edit['title'] = $this->randomName();
$edit['body'] = $this->randomName(); $edit['body'] = $this->randomName();
...@@ -438,7 +438,7 @@ class RemoveFeedItemTestCase extends AggregatorTestCase { ...@@ -438,7 +438,7 @@ class RemoveFeedItemTestCase extends AggregatorTestCase {
foreach ($feed_urls as $feed_url) { foreach ($feed_urls as $feed_url) {
$feed = $this->createFeed($feed_url); $feed = $this->createFeed($feed_url);
// Update and remove items two times in a row to make sure that removal // Update and remove items two times in a row to make sure that removal
// resets all 'modified' information (modified, etag, hash) and allows for // resets all 'modified' information (modified, etag, hash) and allows for
// immediate update. // immediate update.
$this->updateAndRemove($feed, 2); $this->updateAndRemove($feed, 2);
$this->updateAndRemove($feed, 2); $this->updateAndRemove($feed, 2);
......
...@@ -178,8 +178,8 @@ function block_schema() { ...@@ -178,8 +178,8 @@ function block_schema() {
*/ */
function block_install() { function block_install() {
drupal_install_schema('block'); drupal_install_schema('block');
// Block should go first so that other modules can alter its output // Block should go first so that other modules can alter its output
// during hook_page_alter(). Almost everything on the page is a block, // during hook_page_alter(). Almost everything on the page is a block,
// so before block module runs, there will not be much to alter. // so before block module runs, there will not be much to alter.
db_update('system') db_update('system')
...@@ -199,8 +199,8 @@ function block_uninstall() { ...@@ -199,8 +199,8 @@ function block_uninstall() {
/** /**
* Set system.weight to a low value for block module. * Set system.weight to a low value for block module.
* *
* Block should go first so that other modules can alter its output * Block should go first so that other modules can alter its output
* during hook_page_alter(). Almost everything on the page is a block, * during hook_page_alter(). Almost everything on the page is a block,
* so before block module runs, there will not be much to alter. * so before block module runs, there will not be much to alter.
*/ */
......
...@@ -95,7 +95,7 @@ function block_theme() { ...@@ -95,7 +95,7 @@ function block_theme() {
'block' => array( 'block' => array(
'arguments' => array('block' => NULL), 'arguments' => array('block' => NULL),
'template' => 'block', 'template' => 'block',
), ),