summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-06 05:59:31 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-06 05:59:31 +0000
commited86172814c02747b7036745f0411e34998c6f4a (patch)
tree6246e7451a458ec832aefa9404675709e78e982a
parent526558401680f5d8b402823dbd5d40fd17620980 (diff)
downloadbrdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.gz
brdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.bz2
#331951 by aspilicious, sun, jhodgdon, Morbus, et al: Figure out and apply coding standard for casting.
-rw-r--r--includes/actions.inc2
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/database/mysql/query.inc4
-rw-r--r--includes/database/pgsql/query.inc4
-rw-r--r--includes/database/query.inc16
-rw-r--r--includes/database/select.inc4
-rw-r--r--includes/form.inc8
-rw-r--r--includes/menu.inc14
-rw-r--r--includes/pager.inc4
-rw-r--r--includes/stream_wrappers.inc8
-rw-r--r--includes/theme.inc2
-rw-r--r--includes/xmlrpc.inc2
-rw-r--r--modules/book/book.module2
-rw-r--r--modules/comment/comment.module8
-rw-r--r--modules/comment/comment.test6
-rw-r--r--modules/field/field.api.php2
-rw-r--r--modules/field/modules/list/list.module2
-rw-r--r--modules/field/modules/number/number.module2
-rw-r--r--modules/field/modules/text/text.module2
-rw-r--r--modules/field/tests/field.test4
-rw-r--r--modules/field/tests/field_test.entity.inc6
-rw-r--r--modules/image/image.effects.inc2
-rw-r--r--modules/menu/menu.test2
-rw-r--r--modules/node/node.module2
-rw-r--r--modules/node/node.pages.inc10
-rw-r--r--modules/node/node.test2
-rw-r--r--modules/poll/poll.module2
-rw-r--r--modules/simpletest/drupal_web_test_case.php14
-rw-r--r--modules/simpletest/tests/ajax_forms_test.module4
-rw-r--r--modules/simpletest/tests/batch.test2
-rw-r--r--modules/simpletest/tests/database_test.test2
-rw-r--r--modules/simpletest/tests/system_test.module2
-rw-r--r--modules/simpletest/tests/xmlrpc.test2
-rw-r--r--modules/system/system.admin.inc2
-rw-r--r--modules/taxonomy/taxonomy.admin.inc16
-rw-r--r--modules/taxonomy/taxonomy.module4
-rw-r--r--modules/update/update.fetch.inc14
-rw-r--r--modules/user/user.admin.inc2
-rw-r--r--modules/user/user.module6
-rw-r--r--modules/user/user.pages.inc6
40 files changed, 100 insertions, 100 deletions
diff --git a/includes/actions.inc b/includes/actions.inc
index 26788ed04..129f38d3b 100644
--- a/includes/actions.inc
+++ b/includes/actions.inc
@@ -166,7 +166,7 @@ function actions_list($reset = FALSE) {
}
// See module_implements() for an explanation of this cast.
- return (array)$actions;
+ return (array) $actions;
}
/**
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index ae7a46204..0b79f91a0 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -2520,7 +2520,7 @@ function _registry_check_code($type, $name = NULL) {
if ($lookup_cache[$cache_key]) {
require DRUPAL_ROOT . '/' . $lookup_cache[$cache_key];
}
- return (bool)$lookup_cache[$cache_key];
+ return (bool) $lookup_cache[$cache_key];
}
// This function may get called when the default database is not active, but
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc
index 032508870..843e22dfd 100644
--- a/includes/database/mysql/query.inc
+++ b/includes/database/mysql/query.inc
@@ -34,7 +34,7 @@ class InsertQuery_mysql extends InsertQuery {
$values = $this->fromQuery->getArguments();
}
- $last_insert_id = $this->connection->query((string)$this, $values, $this->queryOptions);
+ $last_insert_id = $this->connection->query((string) $this, $values, $this->queryOptions);
// Re-initialize the values array so that we can re-use this query.
$this->insertValues = array();
@@ -138,7 +138,7 @@ class MergeQuery_mysql extends MergeQuery {
//
// @link http ://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html
$this->queryOptions['return'] = Database::RETURN_AFFECTED;
- return $this->connection->query((string)$this, $values, $this->queryOptions);
+ return $this->connection->query((string) $this, $values, $this->queryOptions);
}
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc
index ac5072c76..0420f4aad 100644
--- a/includes/database/pgsql/query.inc
+++ b/includes/database/pgsql/query.inc
@@ -19,7 +19,7 @@ class InsertQuery_pgsql extends InsertQuery {
return NULL;
}
- $stmt = $this->connection->prepareQuery((string)$this);
+ $stmt = $this->connection->prepareQuery((string) $this);
// Fetch the list of blobs and sequences used on that table.
$table_information = $this->connection->schema()->queryTableInformation($this->table);
@@ -121,7 +121,7 @@ class UpdateQuery_pgsql extends UpdateQuery {
// Because we filter $fields the same way here and in __toString(), the
// placeholders will all match up properly.
- $stmt = $this->connection->prepareQuery((string)$this);
+ $stmt = $this->connection->prepareQuery((string) $this);
// Fetch the list of blobs and sequences used on that table.
$table_information = $this->connection->schema()->queryTableInformation($this->table);
diff --git a/includes/database/query.inc b/includes/database/query.inc
index 43c54f8a8..2e775bea5 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -442,7 +442,7 @@ class InsertQuery extends Query {
// If we're selecting from a SelectQuery, finish building the query and
// pass it back, as any remaining options are irrelevant.
if (!empty($this->fromQuery)) {
- $sql = (string)$this;
+ $sql = (string) $this;
// The SelectQuery may contain arguments, load and pass them through.
return $this->connection->query($sql, $this->fromQuery->getArguments(), $this->queryOptions);
}
@@ -453,7 +453,7 @@ class InsertQuery extends Query {
// we wrap it in a transaction so that it is atomic where possible. On many
// databases, such as SQLite, this is also a notable performance boost.
$transaction = $this->connection->startTransaction();
- $sql = (string)$this;
+ $sql = (string) $this;
foreach ($this->insertValues as $insert_values) {
$last_insert_id = $this->connection->query($sql, $insert_values, $this->queryOptions);
}
@@ -780,7 +780,7 @@ class MergeQuery extends Query {
}
$select = $select->countQuery();
- $sql = (string)$select;
+ $sql = (string) $select;
$arguments = $select->getArguments();
$num_existing = $this->connection->query($sql, $arguments)->fetchField();
@@ -896,7 +896,7 @@ class DeleteQuery extends Query implements QueryConditionInterface {
$values = $this->condition->arguments();
}
- return $this->connection->query((string)$this, $values, $this->queryOptions);
+ return $this->connection->query((string) $this, $values, $this->queryOptions);
}
public function __toString() {
@@ -936,7 +936,7 @@ class TruncateQuery extends Query {
}
public function execute() {
- return $this->connection->query((string)$this, array(), $this->queryOptions);
+ return $this->connection->query((string) $this, array(), $this->queryOptions);
}
public function __toString() {
@@ -1096,7 +1096,7 @@ class UpdateQuery extends Query implements QueryConditionInterface {
$update_values = array_merge($update_values, $this->condition->arguments());
}
- return $this->connection->query((string)$this, $update_values, $this->queryOptions);
+ return $this->connection->query((string) $this, $update_values, $this->queryOptions);
}
public function __toString() {
@@ -1218,7 +1218,7 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
if ($condition['field'] instanceof QueryConditionInterface) {
// Compile the sub-condition recursively and add it to the list.
$condition['field']->compile($connection, $queryPlaceholder);
- $condition_fragments[] = '(' . (string)$condition['field'] . ')';
+ $condition_fragments[] = '(' . (string) $condition['field'] . ')';
$arguments += $condition['field']->arguments();
}
else {
@@ -1240,7 +1240,7 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
$placeholders = array();
if ($condition['value'] instanceof SelectQueryInterface) {
$condition['value']->compile($connection, $queryPlaceholder);
- $placeholders[] = (string)$condition['value'];
+ $placeholders[] = (string) $condition['value'];
$arguments += $condition['value']->arguments();
}
// We assume that if there is a delimiter, then the value is an
diff --git a/includes/database/select.inc b/includes/database/select.inc
index 48bd04daf..3e7d27762 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -750,7 +750,7 @@ class SelectQueryExtender implements SelectQueryInterface {
}
public function __toString() {
- return (string)$this->query;
+ return (string) $this->query;
}
public function __clone() {
@@ -1103,7 +1103,7 @@ class SelectQuery extends Query implements SelectQueryInterface {
}
$args = $this->getArguments();
- return $this->connection->query((string)$this, $args, $this->queryOptions);
+ return $this->connection->query((string) $this, $args, $this->queryOptions);
}
public function distinct($distinct = TRUE) {
diff --git a/includes/form.inc b/includes/form.inc
index 92574d202..f271eebfe 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -491,7 +491,7 @@ function form_state_keys_no_cache() {
* $form_state['values']['body'] = 'This is the body text!';
* $form_state['values']['name'] = 'robo-user';
* $form_state['values']['op'] = t('Save');
- * drupal_form_submit('story_node_form', $form_state, (object)$node);
+ * drupal_form_submit('story_node_form', $form_state, (object) $node);
* @endcode
*/
function drupal_form_submit($form_id, &$form_state) {
@@ -1866,7 +1866,7 @@ function form_type_textfield_value($element, $input = FALSE) {
*/
function form_type_token_value($element, $input = FALSE) {
if ($input !== FALSE) {
- return (string)$input;
+ return (string) $input;
}
}
@@ -1998,8 +1998,8 @@ function form_select_options($element, $choices = NULL) {
$options .= form_select_options($element, $choice->option);
}
else {
- $key = (string)$key;
- if ($value_valid && (!$value_is_array && (string)$element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) {
+ $key = (string) $key;
+ if ($value_valid && (!$value_is_array && (string) $element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) {
$selected = ' selected="selected"';
}
else {
diff --git a/includes/menu.inc b/includes/menu.inc
index beee1f060..e146f318c 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -574,7 +574,7 @@ function _menu_check_access(&$item, $map) {
$callback = empty($item['access_callback']) ? 0 : trim($item['access_callback']);
// Check for a TRUE or FALSE value.
if (is_numeric($callback)) {
- $item['access'] = (bool)$callback;
+ $item['access'] = (bool) $callback;
}
else {
$arguments = menu_unserialize($item['access_arguments'], $map);
@@ -978,7 +978,7 @@ function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
// Use $mlid as a flag for whether the data being loaded is for the whole tree.
$mlid = isset($link['mlid']) ? $link['mlid'] : 0;
// Generate a cache ID (cid) specific for this $menu_name, $link, $language, and depth.
- $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . $GLOBALS['language']->language . ':' . (int)$max_depth;
+ $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . $GLOBALS['language']->language . ':' . (int) $max_depth;
if (!isset($tree[$cid])) {
// If the static variable doesn't have the data, check {cache_menu}.
@@ -1090,7 +1090,7 @@ function menu_tree_page_data($menu_name, $max_depth = NULL) {
$max_depth = min($max_depth, MENU_MAX_DEPTH);
}
// Generate a cache ID (cid) specific for this page.
- $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . $GLOBALS['language']->language . ':' . (int)$item['access'] . ':' . (int)$max_depth;
+ $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . $GLOBALS['language']->language . ':' . (int) $item['access'] . ':' . (int) $max_depth;
if (!isset($tree[$cid])) {
// If the static variable doesn't have the data, check {cache_menu}.
@@ -2141,7 +2141,7 @@ function menu_set_active_trail($new_trail = NULL) {
// Make sure the current page is in the trail (needed for the page title),
// but exclude tabs and the front page.
$last = count($trail) - 1;
- if ($trail[$last]['href'] != $item['href'] && !(bool)($item['type'] & MENU_IS_LOCAL_TASK) && !drupal_is_front_page()) {
+ if ($trail[$last]['href'] != $item['href'] && !(bool) ($item['type'] & MENU_IS_LOCAL_TASK) && !drupal_is_front_page()) {
$trail[] = $item;
}
}
@@ -2192,7 +2192,7 @@ function menu_get_active_title() {
$active_trail = menu_get_active_trail();
foreach (array_reverse($active_trail) as $item) {
- if (!(bool)($item['type'] & MENU_IS_LOCAL_TASK)) {
+ if (!(bool) ($item['type'] & MENU_IS_LOCAL_TASK)) {
return $item['title'];
}
}
@@ -3107,8 +3107,8 @@ function _menu_router_build($callbacks) {
'_fit' => $fit,
);
$item += array(
- '_visible' => (bool)($item['type'] & MENU_VISIBLE_IN_BREADCRUMB),
- '_tab' => (bool)($item['type'] & MENU_IS_LOCAL_TASK),
+ '_visible' => (bool) ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB),
+ '_tab' => (bool) ($item['type'] & MENU_IS_LOCAL_TASK),
);
if ($move) {
$new_path = implode('/', $item['_parts']);
diff --git a/includes/pager.inc b/includes/pager.inc
index a33087c64..3398a791e 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -85,7 +85,7 @@ class PagerDefault extends SelectQueryExtender {
// We calculate the total of pages as ceil(items / limit).
$pager_total_items[$this->element] = $this->getCountQuery()->execute()->fetchField();
$pager_total[$this->element] = ceil($pager_total_items[$this->element] / $this->limit);
- $pager_page_array[$this->element] = max(0, min((int)$pager_page_array[$this->element], ((int)$pager_total[$this->element]) - 1));
+ $pager_page_array[$this->element] = max(0, min((int) $pager_page_array[$this->element], ((int) $pager_total[$this->element]) - 1));
$pager_limits[$this->element] = $this->limit;
$this->range($pager_page_array[$this->element] * $this->limit, $this->limit);
@@ -528,6 +528,6 @@ function pager_load_array($value, $element, $old_array) {
}
}
// Update the changed element.
- $new_array[$element] = (int)$value;
+ $new_array[$element] = (int) $value;
return $new_array;
}
diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc
index 87acc5440..a870904a3 100644
--- a/includes/stream_wrappers.inc
+++ b/includes/stream_wrappers.inc
@@ -336,11 +336,11 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
$path = $this->getLocalPath();
$this->handle = ($options & STREAM_REPORT_ERRORS) ? fopen($path, $mode) : @fopen($path, $mode);
- if ((bool)$this->handle && $options & STREAM_USE_PATH) {
+ if ((bool) $this->handle && $options & STREAM_USE_PATH) {
$opened_url = $path;
}
- return (bool)$this->handle;
+ return (bool) $this->handle;
}
/**
@@ -506,7 +506,7 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
*/
public function mkdir($uri, $mode, $options) {
$this->uri = $uri;
- $recursive = (bool)($options & STREAM_MKDIR_RECURSIVE);
+ $recursive = (bool) ($options & STREAM_MKDIR_RECURSIVE);
if ($recursive) {
// $this->getLocalPath() fails if $uri has multiple levels of directories
// that do not yet exist.
@@ -581,7 +581,7 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
$this->uri = $uri;
$this->handle = opendir($this->getLocalPath());
- return (bool)$this->handle;
+ return (bool) $this->handle;
}
/**
diff --git a/includes/theme.inc b/includes/theme.inc
index c409fadeb..7ddba732b 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2501,7 +2501,7 @@ function template_preprocess_username(&$variables) {
}
}
else {
- $variables['uid'] = (int)$account->uid;
+ $variables['uid'] = (int) $account->uid;
}
// Set the name to a formatted name that is safe for printing and
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index a3c2c1d58..fd2266d70 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -260,7 +260,7 @@ function xmlrpc_message_tag_close($parser, $tag) {
// If no type is indicated, the type is string
// We take special care for empty values
if (trim($xmlrpc_message->current_tag_contents) != '' || (isset($xmlrpc_message->last_open) && ($xmlrpc_message->last_open == 'value'))) {
- $value = (string)$xmlrpc_message->current_tag_contents;
+ $value = (string) $xmlrpc_message->current_tag_contents;
$value_flag = TRUE;
}
unset($xmlrpc_message->last_open);
diff --git a/modules/book/book.module b/modules/book/book.module
index f7f2219e8..ddf845563 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -540,7 +540,7 @@ function _book_add_form_elements(&$form, &$form_state, $node) {
'#title' => t('Book'),
'#default_value' => $node->book['bid'],
'#options' => $options,
- '#access' => (bool)$options,
+ '#access' => (bool) $options,
'#description' => t('Your page will be a part of the selected book.'),
'#weight' => -5,
'#attributes' => array('class' => array('book-title-select')),
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index b78210d2c..a688daa01 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -422,7 +422,7 @@ function comment_block_configure($delta = '') {
* Implements hook_block_save().
*/
function comment_block_save($delta = '', $edit = array()) {
- variable_set('comment_block_count', (int)$edit['comment_block_count']);
+ variable_set('comment_block_count', (int) $edit['comment_block_count']);
}
/**
@@ -2089,7 +2089,7 @@ function comment_submit($comment) {
$comment['subject'] = t('(No subject)');
}
}
- return (object)$comment;
+ return (object) $comment;
}
/**
@@ -2100,7 +2100,7 @@ function comment_form_submit_build_comment($form, &$form_state) {
field_attach_submit('comment', $comment, $form, $form_state);
- $form_state['comment'] = (array)$comment;
+ $form_state['comment'] = (array) $comment;
$form_state['rebuild'] = TRUE;
return $comment;
}
@@ -2363,7 +2363,7 @@ function _comment_update_node_statistics($nid) {
* 31000, 31001, ...
*/
function int2vancode($i = 0) {
- $num = base_convert((int)$i, 10, 36);
+ $num = base_convert((int) $i, 10, 36);
$length = strlen($num);
return chr($length + ord('0') - 1) . $num;
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 570724552..8213adcc6 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -1248,15 +1248,15 @@ class CommentRdfaTestCase extends CommentHelperCase {
$comment_container = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]');
$this->assertTrue(!empty($comment_container), t("Comment RDF type for comment found."));
$comment_title = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//h3[@property="dc:title"]');
- $this->assertEqual((string)$comment_title[0]->a, $comment->subject, t("RDFa markup for the comment title found."));
+ $this->assertEqual((string) $comment_title[0]->a, $comment->subject, t("RDFa markup for the comment title found."));
$comment_date = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//*[contains(@property, "dc:date") and contains(@property, "dc:created")]');
$this->assertTrue(!empty($comment_date), t("RDFa markup for the date of the comment found."));
// The author tag can be either a or span
$comment_author = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name"]');
$name = empty($account["name"]) ? $this->web_user->name : $account["name"] . " (not verified)";
- $this->assertEqual((string)$comment_author[0], $name, t("RDFa markup for the comment author found."));
+ $this->assertEqual((string) $comment_author[0], $name, t("RDFa markup for the comment author found."));
$comment_body = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//div[@class="content"]//div[contains(@class, "comment-body")]//div[@property="content:encoded"]');
- $this->assertEqual((string)$comment_body[0]->p, $comment->comment, t("RDFa markup for the comment body found."));
+ $this->assertEqual((string) $comment_body[0]->p, $comment->comment, t("RDFa markup for the comment body found."));
}
}
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index bed020d04..e37254a16 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -587,7 +587,7 @@ function hook_field_prepare_translation($entity_type, $entity, $field, $instance
* FALSE otherwise.
*/
function hook_field_is_empty($item, $field) {
- if (empty($item['value']) && (string)$item['value'] !== '0') {
+ if (empty($item['value']) && (string) $item['value'] !== '0') {
return TRUE;
}
return FALSE;
diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module
index d42f1f439..8ca12025b 100644
--- a/modules/field/modules/list/list.module
+++ b/modules/field/modules/list/list.module
@@ -310,7 +310,7 @@ function list_field_validate($entity_type, $entity, $field, $instance, $langcode
* Implements hook_field_is_empty().
*/
function list_field_is_empty($item, $field) {
- if (empty($item['value']) && (string)$item['value'] !== '0') {
+ if (empty($item['value']) && (string) $item['value'] !== '0') {
return TRUE;
}
return FALSE;
diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module
index e06d35852..8fd19a0e0 100644
--- a/modules/field/modules/number/number.module
+++ b/modules/field/modules/number/number.module
@@ -214,7 +214,7 @@ function number_field_presave($entity_type, $entity, $field, $instance, $langcod
* Implements hook_field_is_empty().
*/
function number_field_is_empty($item, $field) {
- if (empty($item['value']) && (string)$item['value'] !== '0') {
+ if (empty($item['value']) && (string) $item['value'] !== '0') {
return TRUE;
}
return FALSE;
diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module
index 02357ef8f..47d41ab0d 100644
--- a/modules/field/modules/text/text.module
+++ b/modules/field/modules/text/text.module
@@ -221,7 +221,7 @@ function text_field_load($entity_type, $entities, $field, $instances, $langcode,
* Implements hook_field_is_empty().
*/
function text_field_is_empty($item, $field) {
- if (empty($item['value']) && (string)$item['value'] !== '0') {
+ if (empty($item['value']) && (string) $item['value'] !== '0') {
return TRUE;
}
return FALSE;
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index 378319a44..589d0b886 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -1576,7 +1576,7 @@ class FieldFormTestCase extends FieldTestCase {
// We'll need three slightly different formats to check the values.
$values[$delta] = $value;
$weights[$delta] = $weight;
- $field_values[$weight]['value'] = (string)$value;
+ $field_values[$weight]['value'] = (string) $value;
$pattern[$weight] = "<input [^>]*value=\"$value\" [^>]*";
}
@@ -1644,7 +1644,7 @@ class FieldFormTestCase extends FieldTestCase {
// We'll need three slightly different formats to check the values.
$values[$delta] = $value;
$weights[$delta] = $weight;
- $field_values[$weight]['value'] = (string)$value;
+ $field_values[$weight]['value'] = (string) $value;
$pattern[$weight] = "<input [^>]*value=\"$value\" [^>]*";
}
// Press 'add more' button through AJAX, and place the expected HTML result
diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc
index fb9130baf..953b0a01c 100644
--- a/modules/field/tests/field_test.entity.inc
+++ b/modules/field/tests/field_test.entity.inc
@@ -255,9 +255,9 @@ function field_test_entity_edit($entity) {
*/
function field_test_entity_form($form, &$form_state, $entity, $add = FALSE) {
if (isset($form_state['test_entity'])) {
- $entity = $form_state['test_entity'] + (array)$entity;
+ $entity = $form_state['test_entity'] + (array) $entity;
}
- $entity = (object)$entity;
+ $entity = (object) $entity;
foreach (array('ftid', 'ftvid', 'fttype') as $key) {
$form[$key] = array(
@@ -325,7 +325,7 @@ function field_test_entity_form_submit_builder($form, &$form_state) {
$entity->revision = !empty($form_state['values']['revision']);
field_attach_submit('test_entity', $entity, $form, $form_state);
- $form_state['test_entity'] = (array)$entity;
+ $form_state['test_entity'] = (array) $entity;
$form_state['rebuild'] = TRUE;
return $entity;
diff --git a/modules/image/image.effects.inc b/modules/image/image.effects.inc
index f7120c5ac..5171be1d0 100644
--- a/modules/image/image.effects.inc
+++ b/modules/image/image.effects.inc
@@ -232,7 +232,7 @@ function image_rotate_effect(&$image, $data) {
}
if (!empty($data['random'])) {
- $degrees = abs((float)$data['degrees']);
+ $degrees = abs((float) $data['degrees']);
$data['degrees'] = rand(-1 * $degrees, $degrees);
}
diff --git a/modules/menu/menu.test b/modules/menu/menu.test
index 960bc897c..d1b822699 100644
--- a/modules/menu/menu.test
+++ b/modules/menu/menu.test
@@ -483,7 +483,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Load menu link.
// Use api function so that link is translated for rendering.
$item = menu_link_load($mlid);
- $this->assertTrue((bool)$item, 'Standard menu link was loaded');
+ $this->assertTrue((bool) $item, 'Standard menu link was loaded');
return $item;
}
diff --git a/modules/node/node.module b/modules/node/node.module
index cea1355c5..675167128 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1341,7 +1341,7 @@ function template_preprocess_node(&$variables) {
}
// Flatten the node object's member fields.
- $variables = array_merge((array)$node, $variables);
+ $variables = array_merge((array) $node, $variables);
// Helpful $content variable for templates.
foreach (element_children($variables['elements']) as $key) {
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 3ecfbf5ad..939786244 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -66,7 +66,7 @@ function node_add($type) {
// If a node type has been specified, validate its existence.
if (isset($types[$type])) {
// Initialize settings:
- $node = (object)array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => LANGUAGE_NONE);
+ $node = (object) array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => LANGUAGE_NONE);
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH);
$output = drupal_get_form($type . '_node_form', $node);
@@ -76,7 +76,7 @@ function node_add($type) {
}
function node_form_validate($form, &$form_state) {
- $node = (object)$form_state['values'];
+ $node = (object) $form_state['values'];
node_validate($node, $form);
// Field validation. Requires access to $form_state, so this cannot be
@@ -95,7 +95,7 @@ function node_form($form, &$form_state, $node) {
}
if (isset($form_state['node'])) {
- $node = (object)($form_state['node'] + (array)$node);
+ $node = (object) ($form_state['node'] + (array) $node);
}
if (isset($form_state['node_preview'])) {
$form['#prefix'] = $form_state['node_preview'];
@@ -421,11 +421,11 @@ function node_form_submit_build_node($form, &$form_state) {
// functions to process the form values into an updated node.
unset($form_state['submit_handlers']);
form_execute_handlers('submit', $form, $form_state);
- $node = node_submit((object)$form_state['values']);
+ $node = node_submit((object) $form_state['values']);
field_attach_submit('node', $node, $form, $form_state);
- $form_state['node'] = (array)$node;
+ $form_state['node'] = (array) $node;
$form_state['rebuild'] = TRUE;
return $node;
}
diff --git a/modules/node/node.test b/modules/node/node.test
index 4697a7202..31e021ec9 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -1655,7 +1655,7 @@ class NodeQueryAlter extends DrupalWebTestCase {
}
catch (Exception $e) {
$this->fail($e->getMessage());
- $this->fail((string)$query);
+ $this->fail((string) $query);
$this->fail(t('Altered query is malformed'));
}
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index f7eb9ebaa..7ce88b055 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -421,7 +421,7 @@ function poll_choice_js($form, $form_state) {
function poll_node_form_submit(&$form, &$form_state) {
// Renumber fields
$form_state['values']['choice'] = array_values($form_state['values']['choice']);
- $form_state['values']['teaser'] = poll_teaser((object)$form_state['values']);
+ $form_state['values']['teaser'] = poll_teaser((object) $form_state['values']);
}
/**
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index d7d95869b..16e661f15 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -837,7 +837,7 @@ class DrupalWebTestCase extends DrupalTestCase {
'locked' => 0,
);
$type = $forced + $settings + $defaults;
- $type = (object)$type;
+ $type = (object) $type;
$saved_type = node_type_save($type);
node_types_rebuild();
@@ -1866,8 +1866,8 @@ class DrupalWebTestCase extends DrupalTestCase {
$name = (string) $element['name'];
// This can either be the type of <input> or the name of the tag itself
// for <select> or <textarea>.
- $type = isset($element['type']) ? (string)$element['type'] : $element->getName();
- $value = isset($element['value']) ? (string)$element['value'] : '';
+ $type = isset($element['type']) ? (string) $element['type'] : $element->getName();
+ $value = isset($element['value']) ? (string) $element['value'] : '';
$done = FALSE;
if (isset($edit[$name])) {
switch ($type) {
@@ -1906,7 +1906,7 @@ class DrupalWebTestCase extends DrupalTestCase {
$index = 0;
$key = preg_replace('/\[\]$/', '', $name);
foreach ($options as $option) {
- $option_value = (string)$option['value'];
+ $option_value = (string) $option['value'];
if (in_array($option_value, $new_value)) {
$post[$key . '[' . $index++ . ']'] = $option_value;
$done = TRUE;
@@ -1942,7 +1942,7 @@ class DrupalWebTestCase extends DrupalTestCase {
if (!isset($post[$name]) && !$done) {
switch ($type) {
case 'textarea':
- $post[$name] = (string)$element;
+ $post[$name] = (string) $element;
break;
case 'select':
$single = empty($element['multiple']);
@@ -1956,10 +1956,10 @@ class DrupalWebTestCase extends DrupalTestCase {
if ($option['selected'] || ($first && $single)) {
$first = FALSE;
if ($single) {
- $post[$name] = (string)$option['value'];
+ $post[$name] = (string) $option['value'];
}
else {
- $post[$key . '[' . $index++ . ']'] = (string)$option['value'];
+ $post[$key . '[' . $index++ . ']'] = (string) $option['value'];
}
}
}
diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module
index db8aa3b92..fa23acda8 100644
--- a/modules/simpletest/tests/ajax_forms_test.module
+++ b/modules/simpletest/tests/ajax_forms_test.module
@@ -81,8 +81,8 @@ function ajax_forms_test_simple_form_select_callback($form, $form_state) {
*/
function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) {
$commands = array();
- $commands[] = ajax_command_html('#ajax_checkbox_value', (int)$form_state['values']['checkbox']);
- $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int)$form_state['values']['checkbox']);
+ $commands[] = ajax_command_html('#ajax_checkbox_value', (int) $form_state['values']['checkbox']);
+ $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int) $form_state['values']['checkbox']);
return array('#type' => 'ajax', '#commands' => $commands);
}
diff --git a/modules/simpletest/tests/batch.test b/modules/simpletest/tests/batch.test
index 54b29c8a9..451575cf2 100644
--- a/modules/simpletest/tests/batch.test
+++ b/modules/simpletest/tests/batch.test
@@ -352,7 +352,7 @@ class BatchPercentagesUnitTestCase extends DrupalUnitTestCase {
foreach ($this->testCases as $expected_result => $arguments) {
// PHP sometimes casts numeric strings that are array keys to integers,
// cast them back here.
- $expected_result = (string)$expected_result;
+ $expected_result = (string) $expected_result;
$total = $arguments['total'];
$current = $arguments['current'];
$actual_result = _batch_api_percentage($total, $current);
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 09c310cd5..064ed3890 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -456,7 +456,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$query->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before + 1, (int)$num_records_after, t('Record inserts correctly.'));
+ $this->assertIdentical($num_records_before + 1, (int) $num_records_after, t('Record inserts correctly.'));
$saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Yoko'))->fetchField();
$this->assertIdentical($saved_age, '29', t('Can retrieve after inserting.'));
}
diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module
index a638b70f5..24167ced4 100644
--- a/modules/simpletest/tests/system_test.module
+++ b/modules/simpletest/tests/system_test.module
@@ -115,7 +115,7 @@ function system_test_basic_auth_page() {
}
function system_test_redirect($code) {
- $code = (int)$code;
+ $code = (int) $code;
if ($code != 200) {
header("Location: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
exit;
diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test
index a9e8bca40..8ba943855 100644
--- a/modules/simpletest/tests/xmlrpc.test
+++ b/modules/simpletest/tests/xmlrpc.test
@@ -155,7 +155,7 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase {
for ($y = 2000; $y < 2002; $y++) {
for ($m = 3; $m < 5; $m++) {
for ($d = 1; $d < 6; $d++) {
- $ys = (string)$y;
+ $ys = (string) $y;
$ms = sprintf('%02d', $m);
$ds = sprintf('%02d', $d);
$struct_7[$ys][$ms][$ds]['moe'] = mt_rand(-100, 100);
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 1725598e0..4b59973bd 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -2466,7 +2466,7 @@ function theme_status_report($variables) {
REQUIREMENT_WARNING => 'warning',
REQUIREMENT_ERROR => 'error',
);
- $class = $classes[isset($requirement['severity']) ? (int)$requirement['severity'] : 0] . ' ' . $class;
+ $class = $classes[isset($requirement['severity']) ? (int) $requirement['severity'] : 0] . ' ' . $class;
// Output table row(s)
if (!empty($requirement['description'])) {
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index e1dfdec2f..4ae0e5182 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -101,7 +101,7 @@ function theme_taxonomy_overview_vocabularies($variables) {
*/
function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
if (!is_array($edit)) {
- $edit = (array)$edit;
+ $edit = (array) $edit;
}
$edit += array(
'name' => '',
@@ -352,7 +352,7 @@ function taxonomy_overview_terms($form, &$form_state, $vocabulary) {
// Build the actual form.
foreach ($current_page as $key => $term) {
// Save the term for the current page so we don't have to load it a second time.
- $form[$key]['#term'] = (array)$term;
+ $form[$key]['#term'] = (array) $term;
if (isset($term->parents)) {
$form[$key]['#term']['parent'] = $term->parent = $term->parents[0];
unset($form[$key]['#term']['parents'], $term->parents);
@@ -444,7 +444,7 @@ function taxonomy_overview_terms_submit($form, &$form_state) {
// Build a list of all terms that need to be updated on previous pages.
$weight = 0;
- $term = (array)$tree[0];
+ $term = (array) $tree[0];
while ($term['tid'] != $form['#first_tid']) {
if ($term['parents'][0] == 0 && $term['weight'] != $weight) {
$term['parent'] = $term['parents'][0];
@@ -453,7 +453,7 @@ function taxonomy_overview_terms_submit($form, &$form_state) {
}
$weight++;
$hierarchy = $term['parents'][0] != 0 ? 1 : $hierarchy;
- $term = (array)$tree[$weight];
+ $term = (array) $tree[$weight];
}
// Renumber the current page weights and assign any new parents.
@@ -486,7 +486,7 @@ function taxonomy_overview_terms_submit($form, &$form_state) {
// Build a list of all terms that need to be updated on following pages.
for ($weight; $weight < count($tree); $weight++) {
- $term = (array)$tree[$weight];
+ $term = (array) $tree[$weight];
if ($term['parents'][0] == 0 && $term['weight'] != $weight) {
$term['parent'] = $term['parents'][0];
$term['weight'] = $weight;
@@ -497,7 +497,7 @@ function taxonomy_overview_terms_submit($form, &$form_state) {
// Save all updated terms.
foreach ($changed_terms as $changed) {
- $term = (object)$changed;
+ $term = (object) $changed;
// Update term_hierachy and term_data directly since we don't have a
// fully populated term object to save.
db_update('taxonomy_term_hierarchy')
@@ -619,7 +619,7 @@ function theme_taxonomy_overview_terms($variables) {
function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary = NULL) {
if (!isset($vocabulary) && is_object($edit)) {
$vocabulary = taxonomy_vocabulary_load($edit->vid);
- $edit = (array)$edit;
+ $edit = (array) $edit;
}
$edit += array(
'name' => '',
@@ -839,7 +839,7 @@ function taxonomy_form_term_submit_builder($form, &$form_state) {
$term = (object) $form_state['values'];
field_attach_submit('taxonomy_term', $term, $form, $form_state);
- $form_state['term'] = (array)$term;
+ $form_state['term'] = (array) $term;
$form_state['rebuild'] = TRUE;
return $term;
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index ac46898db..b61a83dd1 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -432,7 +432,7 @@ function taxonomy_check_vocabulary_hierarchy($vocabulary, $changed_term) {
foreach ($tree as $term) {
// Update the changed term with the new parent value before comparison.
if ($term->tid == $changed_term['tid']) {
- $term = (object)$changed_term;
+ $term = (object) $changed_term;
$term->parents = $term->parent;
}
// Check this term's parent count.
@@ -614,7 +614,7 @@ function template_preprocess_taxonomy_term(&$variables) {
$variables['page'] = taxonomy_term_is_page($term);
// Flatten the term object's member fields.
- $variables = array_merge((array)$term, $variables);
+ $variables = array_merge((array) $term, $variables);
// Helpful $content variable for templates.
foreach (element_children($variables['elements']) as $key) {
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index b21df684d..b3041cbc5 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -361,26 +361,26 @@ function update_parse_xml($raw_xml) {
if (!isset($xml->short_name)) {
return;
}
- $short_name = (string)$xml->short_name;
+ $short_name = (string) $xml->short_name;
$data = array();
foreach ($xml as $k => $v) {
- $data[$k] = (string)$v;
+ $data[$k] = (string) $v;
}
$data['releases'] = array();
if (isset($xml->releases)) {
foreach ($xml->releases->children() as $release) {
- $version = (string)$release->version;
+ $version = (string) $release->version;
$data['releases'][$version] = array();
foreach ($release->children() as $k => $v) {
- $data['releases'][$version][$k] = (string)$v;
+ $data['releases'][$version][$k] = (string) $v;
}
$data['releases'][$version]['terms'] = array();
if ($release->terms) {
foreach ($release->terms->children() as $term) {
- if (!isset($data['releases'][$version]['terms'][(string)$term->name])) {
- $data['releases'][$version]['terms'][(string)$term->name] = array();
+ if (!isset($data['releases'][$version]['terms'][(string) $term->name])) {
+ $data['releases'][$version]['terms'][(string) $term->name] = array();
}
- $data['releases'][$version]['terms'][(string)$term->name][] = (string)$term->value;
+ $data['releases'][$version]['terms'][(string) $term->name][] = (string) $term->value;
}
}
}
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index b0970019b..043ee97a4 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -975,7 +975,7 @@ function user_admin_role_validate($form, &$form_state) {
* Form submit handler for the user_admin_role() form.
*/
function user_admin_role_submit($form, &$form_state) {
- $role = (object)$form_state['values'];
+ $role = (object) $form_state['values'];
if ($form_state['values']['op'] == t('Save role')) {
user_role_save($role);
drupal_set_message(t('The role has been renamed.'));
diff --git a/modules/user/user.module b/modules/user/user.module
index 891bc478c..e8a0cd18d 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1400,7 +1400,7 @@ function user_is_anonymous() {
}
function user_is_logged_in() {
- return (bool)$GLOBALS['user']->uid;
+ return (bool) $GLOBALS['user']->uid;
}
function user_register_access() {
@@ -3032,8 +3032,8 @@ function _user_categories() {
}
function _user_sort($a, $b) {
- $a = (array)$a + array('weight' => 0, 'title' => '');
- $b = (array)$b + array('weight' => 0, 'title' => '');
+ $a = (array) $a + array('weight' => 0, 'title' => '');
+ $b = (array) $b + array('weight' => 0, 'title' => '');
return $a['weight'] < $b['weight'] ? -1 : ($a['weight'] > $b['weight'] ? 1 : ($a['title'] < $b['title'] ? -1 : 1));
}
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 2ec4df176..32c20a4d7 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -278,7 +278,7 @@ function user_profile_form($form, &$form_state, $account, $category = 'account')
* Validation function for the user account and profile editing form.
*/
function user_profile_form_validate($form, &$form_state) {
- $edit = (object)$form_state['values'];
+ $edit = (object) $form_state['values'];
field_attach_form_validate('user', $edit, $form, $form_state);
}
@@ -291,9 +291,9 @@ function user_profile_form_submit($form, &$form_state) {
// Remove unneeded values.
form_state_values_clean($form_state);
- $edit = (object)$form_state['values'];
+ $edit = (object) $form_state['values'];
field_attach_submit('user', $edit, $form, $form_state);
- $edit = (array)$edit;
+ $edit = (array) $edit;
user_save($account, $edit, $category);
$form_state['values']['uid'] = $account->uid;