diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-05-06 05:59:31 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-05-06 05:59:31 +0000 |
commit | ed86172814c02747b7036745f0411e34998c6f4a (patch) | |
tree | 6246e7451a458ec832aefa9404675709e78e982a /modules | |
parent | 526558401680f5d8b402823dbd5d40fd17620980 (diff) | |
download | brdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.gz brdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.bz2 |
#331951 by aspilicious, sun, jhodgdon, Morbus, et al: Figure out and apply coding standard for casting.
Diffstat (limited to 'modules')
28 files changed, 65 insertions, 65 deletions
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; |