summaryrefslogtreecommitdiff
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
parent88bc80a5974a5ff6bfedf0083934e791bf7cfcd7 (diff)
downloadbrdo-3780b17654a2af093c854f9c32bd2d6e102ec16c.tar.gz
brdo-3780b17654a2af093c854f9c32bd2d6e102ec16c.tar.bz2
- Patch #921606 by munzirtaha, bleen18: various code uses is_null().
-rw-r--r--includes/common.inc2
-rw-r--r--includes/file.inc6
-rw-r--r--includes/form.inc4
-rw-r--r--includes/theme.inc2
-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
-rwxr-xr-xscripts/run-tests.sh2
14 files changed, 22 insertions, 22 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 6611d418c..0c3851411 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1616,7 +1616,7 @@ function format_rss_item($title, $link, $description, $args = array()) {
* Format XML elements.
*
* @param $array
- * An array where each item represent an element and is either a:
+ * An array where each item represents an element and is either a:
* - (key => value) pair (<key>value</key>)
* - Associative array with fields:
* - 'key': element name
diff --git a/includes/file.inc b/includes/file.inc
index f44a78d11..1d4343da0 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -2193,11 +2193,11 @@ function drupal_dirname($uri) {
* @ingroup php_wrappers
*/
function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
- if (is_null($mode)) {
+ if (!isset($mode)) {
$mode = variable_get('file_chmod_directory', 0775);
}
- if (is_null($context)) {
+ if (!isset($context)) {
return mkdir($uri, $mode, $recursive);
}
else {
@@ -2282,7 +2282,7 @@ function drupal_tempnam($directory, $prefix) {
function file_directory_temp() {
$temporary_directory = variable_get('file_directory_temp', NULL);
- if (is_null($temporary_directory)) {
+ if (!isset($temporary_directory)) {
$directories = array();
// Has PHP been set with an upload_tmp_dir?
diff --git a/includes/form.inc b/includes/form.inc
index 5a6ccd20c..4aa536ff5 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2096,7 +2096,7 @@ function form_type_checkboxes_value($element, $input = FALSE) {
// checkboxes to the server at all). This will not affect non-programmatic
// form submissions, since a checkbox can never legitimately be NULL.
foreach ($input as $key => $value) {
- if (is_null($value)) {
+ if (!isset($value)) {
unset($input[$key]);
}
}
@@ -4009,7 +4009,7 @@ function _batch_queue($batch_set) {
// The class autoloader is not available when running update.php, so make
// sure the files are manually included.
- if (is_null($queues)) {
+ if (!isset($queues)) {
$queues = array();
require_once DRUPAL_ROOT . '/modules/system/system.queue.inc';
require_once DRUPAL_ROOT . '/includes/batch.queue.inc';
diff --git a/includes/theme.inc b/includes/theme.inc
index 96222de71..7ce021ef0 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1119,7 +1119,7 @@ function theme_get_setting($setting_name, $theme = NULL) {
$cache = &drupal_static(__FUNCTION__, array());
// If no key is given, use the current theme if we can determine it.
- if (is_null($theme)) {
+ if (!isset($theme)) {
$theme = !empty($GLOBALS['theme_key']) ? $GLOBALS['theme_key'] : '';
}
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.
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 482163a12..ee6c90080 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -302,7 +302,7 @@ function simpletest_script_init($server_software) {
function simpletest_script_execute_batch() {
global $args;
- if (is_null($args['test-id'])) {
+ if (!isset($args['test-id'])) {
simpletest_script_print_error("--execute-batch should not be called interactively.");
exit;
}