summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-09-26 23:31:36 +0000
committerDries Buytaert <dries@buytaert.net>2010-09-26 23:31:36 +0000
commit3780b17654a2af093c854f9c32bd2d6e102ec16c (patch)
tree0289b1288109ca1baecbddc7192f1cea84227e3a /modules
parent88bc80a5974a5ff6bfedf0083934e791bf7cfcd7 (diff)
downloadbrdo-3780b17654a2af093c854f9c32bd2d6e102ec16c.tar.gz
brdo-3780b17654a2af093c854f9c32bd2d6e102ec16c.tar.bz2
- Patch #921606 by munzirtaha, bleen18: various code uses is_null().
Diffstat (limited to 'modules')
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.module2
-rw-r--r--modules/field/tests/field_test.module2
-rw-r--r--modules/field/tests/field_test.storage.inc4
-rw-r--r--modules/field_ui/field_ui.admin.inc2
-rw-r--r--modules/search/search.module2
-rw-r--r--modules/simpletest/tests/batch_test.module2
-rw-r--r--modules/simpletest/tests/file.test8
-rw-r--r--modules/syslog/syslog.module2
-rw-r--r--modules/taxonomy/taxonomy.module4
9 files changed, 14 insertions, 14 deletions
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module
index f916968d1..bc1656bc4 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -106,7 +106,7 @@ function _field_sql_storage_indexname($name, $index) {
*/
function _field_sql_storage_etid($entity_type) {
$etid = variable_get('field_sql_storage_' . $entity_type . '_etid', NULL);
- if (is_null($etid)) {
+ if (!isset($etid)) {
$etid = db_insert('field_config_entity_type')->fields(array('type' => $entity_type))->execute();
variable_set('field_sql_storage_' . $entity_type . '_etid', $etid);
}
diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module
index 3767a8014..425432303 100644
--- a/modules/field/tests/field_test.module
+++ b/modules/field/tests/field_test.module
@@ -152,7 +152,7 @@ function field_test_field_language_alter(&$display_language, $context) {
function field_test_memorize($key = NULL, $value = NULL) {
$memorize = &drupal_static(__FUNCTION__, NULL);
- if (is_null($key)) {
+ if (!isset($key)) {
$return = $memorize;
$memorize = array();
return $return;
diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc
index 532598832..8d87c6eb0 100644
--- a/modules/field/tests/field_test.storage.inc
+++ b/modules/field/tests/field_test.storage.inc
@@ -70,7 +70,7 @@ function field_test_field_storage_details_alter(&$details, $field) {
* Helper function: stores or retrieves data from the 'storage backend'.
*/
function _field_test_storage_data($data = NULL) {
- if (is_null($data)) {
+ if (!isset($data)) {
return variable_get('field_test_storage_data', array());
}
else {
@@ -318,7 +318,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
}
if ($match) {
- if (is_null($skip) || $skipped >= $skip) {
+ if (!isset($skip) || $skipped >= $skip) {
$cursor++;
// If querying all revisions and the entity type has revisions, we need
// to key the results by revision_ids.
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index 7cf0000b3..73115adc1 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -68,7 +68,7 @@ function field_ui_inactive_message($entity_type, $bundle) {
* This is intended as a callback for array_reduce().
*/
function _field_ui_reduce_order($array, $a) {
- $array = is_null($array) ? array() : $array;
+ $array = !isset($array) ? array() : $array;
if ($a['name']) {
$array[] = $a['name'];
}
diff --git a/modules/search/search.module b/modules/search/search.module
index e4f4130ba..5c295e555 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -959,7 +959,7 @@ function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL
if (!$action) {
$action = 'search/' . $module_info['path'];
}
- if (is_null($prompt)) {
+ if (!isset($prompt)) {
$prompt = t('Enter your keywords');
}
diff --git a/modules/simpletest/tests/batch_test.module b/modules/simpletest/tests/batch_test.module
index 03938aaa8..c581eabb3 100644
--- a/modules/simpletest/tests/batch_test.module
+++ b/modules/simpletest/tests/batch_test.module
@@ -466,7 +466,7 @@ function batch_test_stack($data = NULL, $reset = FALSE) {
if ($reset) {
variable_del('batch_test_stack');
}
- if (is_null($data)) {
+ if (!isset($data)) {
return variable_get('batch_test_stack', array());
}
$stack = variable_get('batch_test_stack', array());
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index afb540eb6..55fc1deb7 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -174,7 +174,7 @@ class FileTestCase extends DrupalWebTestCase {
*/
function createDirectory($path = NULL) {
// A directory to operate on.
- if (is_null($path)) {
+ if (!isset($path)) {
$path = file_default_scheme() . '://' . $this->randomName();
}
$this->assertTrue(drupal_mkdir($path) && is_dir($path), t('Directory was created successfully.'));
@@ -198,12 +198,12 @@ class FileTestCase extends DrupalWebTestCase {
* File object.
*/
function createFile($filepath = NULL, $contents = NULL, $scheme = 'public') {
- if (is_null($filepath)) {
+ if (!isset($filepath)) {
$filepath = $this->randomName();
}
$filepath = $scheme . '://' . $filepath;
- if (is_null($contents)) {
+ if (!isset($contents)) {
$contents = "file_put_contents() doesn't seem to appreciate empty strings so let's put in some data.";
}
@@ -282,7 +282,7 @@ class FileHookTestCase extends FileTestCase {
function assertFileHookCalled($hook, $expected_count = 1, $message = NULL) {
$actual_count = count(file_test_get_calls($hook));
- if (is_null($message)) {
+ if (!isset($message)) {
if ($actual_count == $expected_count) {
$message = t('hook_file_@name was called correctly.', array('@name' => $hook));
}
diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module
index 20f8a2823..e887ce243 100644
--- a/modules/syslog/syslog.module
+++ b/modules/syslog/syslog.module
@@ -103,7 +103,7 @@ function syslog_watchdog(array $log_entry) {
'!referer' => $log_entry['referer'],
'!uid' => $log_entry['user']->uid,
'!link' => strip_tags($log_entry['link']),
- '!message' => strip_tags(is_null($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])),
+ '!message' => strip_tags(!isset($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])),
));
syslog($log_entry['severity'], $message);
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index ae3debc19..107bf7aa7 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -841,7 +841,7 @@ function taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $depth = -1) {
}
}
- $max_depth = (is_null($max_depth)) ? count($children[$vid]) : $max_depth;
+ $max_depth = (!isset($max_depth)) ? count($children[$vid]) : $max_depth;
$tree = array();
if ($max_depth > $depth && !empty($children[$vid][$parent])) {
foreach ($children[$vid][$parent] as $child) {
@@ -1038,7 +1038,7 @@ function taxonomy_implode_tags($tags, $vid = NULL) {
$typed_tags = array();
foreach ($tags as $tag) {
// Extract terms belonging to the vocabulary in question.
- if (is_null($vid) || $tag->vid == $vid) {
+ if (!isset($vid) || $tag->vid == $vid) {
// Make sure we have a completed loaded taxonomy term.
if (isset($tag->name)) {
// Commas and quotes in tag names are special cases, so encode 'em.