diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index cf0e3dd..3230171 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2554,12 +2554,12 @@ function language_default_locked_languages($weight = 0) { * @param string $langcode * The language code. * - * @return Drupal\core\Language\Language | FALSE - * A fully-populated language object or FALSE. + * @return Drupal\core\Language\Language|null + * A fully-populated language object or NULL. */ function language_load($langcode) { $languages = language_list(Language::STATE_ALL); - return isset($languages[$langcode]) ? $languages[$langcode] : FALSE; + return isset($languages[$langcode]) ? $languages[$langcode] : NULL; } /** diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 6038fa5..a3ba8e7 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -559,7 +559,7 @@ function _menu_load_objects(&$item, &$map) { $return = $function($value); } // If callback returned an error or there is no callback, trigger 404. - if ($return === FALSE) { + if (empty($return)) { $item['access'] = FALSE; $map = FALSE; return FALSE; diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index e290cd4..94688ee 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -125,8 +125,8 @@ function custom_block_theme($existing, $type, $theme, $path) { * @param int $id * The ID of the custom block type to load. * - * @return Drupal\custom_block\Plugin\Core\Entity\CustomBlockType|false - * A CustomBlockType object or FALSE if the requested $id does not exist. + * @return Drupal\custom_block\Plugin\Core\Entity\CustomBlockType|null + * A CustomBlockType object or NULL if the requested $id does not exist. */ function custom_block_type_load($id) { return entity_load('custom_block_type', $id); @@ -138,8 +138,8 @@ function custom_block_type_load($id) { * @param int $id * The id of the custom block. * - * @return Drupal\custom_block\Plugin\Core\Entity\CustomBlock|false - * A CustomBlock object or FALSE if the requested $id does not exist. + * @return Drupal\custom_block\Plugin\Core\Entity\CustomBlock|null + * A CustomBlock object or NULL if the requested $id does not exist. */ function custom_block_load($id) { return entity_load('custom_block', $id); diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module index b467011..9384b2a 100644 --- a/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -294,8 +294,8 @@ function breakpoint_get_module_media_queries($module) { * @param string $id * The id of the breakpoint group to load. * - * @return Drupal\breakpoint\Plugin\Core\Entity\BreakpointGroup|false - * The breakpoint group, or FALSE if there is no entity with the given id. + * @return Drupal\breakpoint\Plugin\Core\Entity\BreakpointGroup|null + * The breakpoint group, or NULL if there is no entity with the given id. * * @todo Remove this in a follow-up issue. * @see http://drupal.org/node/1798214 @@ -311,7 +311,7 @@ function breakpoint_group_load($id) { * The id of the breakpoint to load. * * @return Drupal\breakpoint\Plugin\Core\Entity\Breakpoint - * The entity object, or FALSE if there is no entity with the given id. + * The entity object, or NULL if there is no entity with the given id. * * @todo Remove this in a follow-up issue. * @see http://drupal.org/node/1798214 diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 64d97b2..d45d10b 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -232,8 +232,8 @@ function contact_field_extra_fields() { * @param $id * The ID of the contact category to load. * - * @return Drupal\contact\Plugin\Core\Entity\Category|false - * A Category object or FALSE if the requested $id does not exist. + * @return Drupal\contact\Plugin\Core\Entity\Category|null + * A Category object or NULL if the requested $id does not exist. */ function contact_category_load($id) { return entity_load('contact_category', $id); diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index a0e78a6..82c6522 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -302,8 +302,8 @@ function editor_form_filter_admin_format_submit($form, &$form_state) { /** * Loads an individual configured text editor based on text format ID. * - * @return \Drupal\editor\Plugin\Core\Entity\Editor|FALSE - * A text editor object, or FALSE. + * @return \Drupal\editor\Plugin\Core\Entity\Editor|null + * A text editor object, or NULL. */ function editor_load($format_id) { // Load all the editors at once here, assuming that either no editors or more @@ -311,7 +311,7 @@ function editor_load($format_id) { // formats for administrators). Loading a small number of editors all at once // is more efficient than loading multiple editors individually. $editors = entity_load_multiple('editor'); - return isset($editors[$format_id]) ? $editors[$format_id] : FALSE; + return isset($editors[$format_id]) ? $editors[$format_id] : NULL; } /** diff --git a/core/modules/file/file.module b/core/modules/file/file.module index f7a7c86..5567a07 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -119,14 +119,13 @@ function file_load_multiple(array $fids = NULL, $reset = FALSE) { * Whether to reset the internal file_load_multiple() cache. * * @return \Drupal\file\FileInterface - * A file entity or FALSE if the file was not found. + * A file entity or NULL if the file was not found. * * @see hook_file_load() * @see file_load_multiple() */ function file_load($fid, $reset = FALSE) { - $files = file_load_multiple(array($fid), $reset); - return reset($files); + return entity_load('file', $fid, $reset); } /** diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 1b90cde..d438d01 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -163,7 +163,7 @@ function filter_menu() { * @return * A fully-populated text format object, if the requested format exists and * is enabled. If the format does not exist, or exists in the database but - * has been marked as disabled, FALSE is returned. + * has been marked as disabled, NULL is returned. * * @see filter_format_exists() * @@ -171,7 +171,7 @@ function filter_menu() { */ function filter_format_load($format_id) { $formats = filter_formats(); - return isset($formats[$format_id]) ? $formats[$format_id] : FALSE; + return isset($formats[$format_id]) ? $formats[$format_id] : NULL; } /** diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 53cb813..37dbddf 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -889,7 +889,7 @@ function image_effect_definitions() { */ function image_effect_definition_load($effect) { $definitions = image_effect_definitions(); - return isset($definitions[$effect]) ? $definitions[$effect] : FALSE; + return isset($definitions[$effect]) ? $definitions[$effect] : NULL; } /** @@ -907,7 +907,7 @@ function image_effect_definition_load($effect) { * - "name": The name of the effect definition that powers this image effect. * - "data": An array of configuration options for this image effect. * Besides these keys, the entirety of the image definition is merged into - * the image effect array. Returns FALSE if the specified effect cannot be + * the image effect array. Returns NULL if the specified effect cannot be * found. * @see image_effect_definition_load() */ @@ -926,7 +926,7 @@ function image_effect_load($ieid, $style_name) { $effect['ieid'] = $ieid; return $effect; } - return FALSE; + return NULL; } /** diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 68c3125..808c0a5 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -238,7 +238,7 @@ function menu_enable() { * @param $menu_name * The unique name of a custom menu to load. * @return - * Array defining the custom menu, or FALSE if the menu doesn't exist. + * Array defining the custom menu, or NULL if the menu doesn't exist. */ function menu_load($menu_name) { return entity_load('menu', $menu_name); diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module index 579737c..222aa83 100644 --- a/core/modules/menu_link/menu_link.module +++ b/core/modules/menu_link/menu_link.module @@ -31,8 +31,8 @@ function menu_link_uri(MenuLink $menu_link) { * @param bool $reset * (optional) Whether to reset the menu_link_load_multiple() cache. * - * @return \Drupal\menu_link\Plugin\Core\Entity\MenuLink|false - * A menu link entity, or FALSE if there is no entity with the given ID. + * @return \Drupal\menu_link\Plugin\Core\Entity\MenuLink|null + * A menu link entity, or NULL if there is no entity with the given ID. */ function menu_link_load($mlid = NULL, $reset = FALSE) { return entity_load('menu_link', $mlid, $reset); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index fbdf07d..a120a9c 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -425,11 +425,11 @@ function node_types_rebuild() { * The machine name of a node type to load. * * @return - * A node type object or FALSE if $name does not exist. + * A node type object or NULL if $name does not exist. */ function node_type_load($name) { $types = _node_types_build()->types; - return isset($types[$name]) ? $types[$name] : FALSE; + return isset($types[$name]) ? $types[$name] : NULL; } /** @@ -890,12 +890,12 @@ function node_load_multiple(array $nids = NULL, $reset = FALSE) { * (optional) Whether to reset the node_load_multiple() cache. Defaults to * FALSE. * - * @return Drupal\node\Node|false - * A fully-populated node entity, or FALSE if the node is not found. + * @return Drupal\node\Node|null + * A fully-populated node entity, or NULL if the node is not found. */ function node_load($nid = NULL, $reset = FALSE) { $entity = entity_load('node', $nid, $reset); - return $entity ? $entity->getBCEntity() : FALSE; + return $entity ? $entity->getBCEntity() : NULL; } /** @@ -904,8 +904,8 @@ function node_load($nid = NULL, $reset = FALSE) { * @param int $nid * The node revision id. * - * @return Drupal\node\Node|false - * A fully-populated node entity, or FALSE if the node is not found. + * @return Drupal\node\Node|null + * A fully-populated node entity, or NULL if the node is not found. */ function node_revision_load($vid = NULL) { return entity_revision_load('node', $vid); diff --git a/core/modules/picture/picture.module b/core/modules/picture/picture.module index ef6ee48..08494df 100644 --- a/core/modules/picture/picture.module +++ b/core/modules/picture/picture.module @@ -105,7 +105,7 @@ function picture_library_info() { * The id of the picture mapping to load. * * @return Drupal\picture\Picture - * The entity object, or FALSE if there is no entity with the given id. + * The entity object, or NULL if there is no entity with the given id. * * @todo Needed for menu_callback * diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index a14a3e7..f06d76b 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -278,7 +278,7 @@ function shortcut_menu_link_delete($menu_link) { * - 'id': The internal name of the shortcut set. * - 'label': The title of the shortcut set. * - 'links': An array of links associated with this shortcut set. - * If the shortcut set does not exist, the function returns FALSE. + * If the shortcut set does not exist, the function returns NULL. */ function shortcut_set_load($id) { return entity_load('shortcut', $id); diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index e9e69c5..4b26440 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -663,9 +663,9 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * This 'abc' object will then be passed into the callback functions defined * for the menu item, such as the page callback function mymodule_abc_edit() * to replace the integer 1 in the argument array. Note that a load function - * should return FALSE when it is unable to provide a loadable object. For + * should return NULL when it is unable to provide a loadable object. For * example, the node_load() function for the 'node/%node/edit' menu item will - * return FALSE for the path 'node/999/edit' if a node with a node ID of 999 + * return NULL for the path 'node/999/edit' if a node with a node ID of 999 * does not exist. The menu routing system will return a 404 error in this case. * * @subsection sub_argument_wildcards Argument Wildcards diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 55d0dac..5f2c46f 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -285,7 +285,7 @@ function entity_test_edit(EntityInterface $entity) { * A boolean indicating that the internal cache should be reset. * * @return \Drupal\entity_test\Plugin\Core\Entity\EntityTest - * The loaded entity object, or FALSE if the entity cannot be loaded. + * The loaded entity object, or NULL if the entity cannot be loaded. */ function entity_test_load($id, $reset = FALSE) { return entity_load('entity_test', $id, $reset); @@ -300,7 +300,7 @@ function entity_test_load($id, $reset = FALSE) { * A boolean indicating that the internal cache should be reset. * * @return \Drupal\entity_test\Plugin\Core\Entity\EntityTestRev - * The loaded entity object, or FALSE if the entity cannot be loaded. + * The loaded entity object, or NULL if the entity cannot be loaded. */ function entity_test_rev_load($id, $reset = FALSE) { return entity_load('entity_test_rev', $id, $reset); @@ -330,7 +330,7 @@ function entity_test_mul_load($id, $reset = FALSE) { * A boolean indicating that the internal cache should be reset. * * @return \Drupal\entity_test\Plugin\Core\Entity\EntityTestMulRev - * The loaded entity object, or FALSE if the entity cannot be loaded. + * The loaded entity object, or NULL if the entity cannot be loaded. */ function entity_test_mulrev_load($id, $reset = FALSE) { return entity_load('entity_test_mulrev', $id, $reset); diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index efafe6b..e1b25ab 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -513,12 +513,12 @@ function menu_test_menu_local_tasks_alter(&$data, $router_item, $root_path) { * A parameter passed in via the URL. * * @return false - * Always return FALSE. + * Always return NULL. * * @see menu_test_menu(); */ function menu_test_argument_load($arg1) { - return FALSE; + return NULL; } /** @@ -528,12 +528,12 @@ function menu_test_argument_load($arg1) { * A parameter passed in via the URL. * * @return false - * Always return FALSE. + * Always return NULL. * * @see menu_test_menu(); */ function menu_test_other_argument_load($arg1) { - return FALSE; + return NULL; } /** diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index b2c6b83..d6b997c 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -835,8 +835,8 @@ function taxonomy_vocabulary_sort(array &$vocabularies = array()) { * @param int $vid * The vocabulary's ID. * - * @return Drupal\taxonomy\Plugin\Core\Entity\Vocabulary|false - * The taxonomy vocabulary entity, if exists, FALSE otherwise. Results are + * @return Drupal\taxonomy\Plugin\Core\Entity\Vocabulary|null + * The taxonomy vocabulary entity, if exists, NULL otherwise. Results are * statically cached. */ function taxonomy_vocabulary_load($vid) { @@ -849,13 +849,13 @@ function taxonomy_vocabulary_load($vid) { * @param $tid * A term's ID * - * @return Drupal\taxonomy\Plugin\Core\Entity\Term|false - * A taxonomy term entity, or FALSE if the term was not found. Results are + * @return Drupal\taxonomy\Plugin\Core\Entity\Term|null + * A taxonomy term entity, or NULL if the term was not found. Results are * statically cached. */ function taxonomy_term_load($tid) { if (!is_numeric($tid)) { - return FALSE; + return NULL; } return entity_load('taxonomy_term', $tid); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index e7ee37a..317df36 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -302,14 +302,14 @@ function user_load_multiple(array $uids = NULL, $reset = FALSE) { * (default) to load from the internal cache, if set. * * @return object - * A fully-loaded user object upon successful user load, or FALSE if the user + * A fully-loaded user object upon successful user load, or NULL if the user * cannot be loaded. * * @see user_load_multiple() */ function user_load($uid, $reset = FALSE) { $user = entity_load('user', $uid, $reset); - return $user ? $user->getBCEntity() : FALSE; + return $user ? $user->getBCEntity() : NULL; } /** @@ -1098,7 +1098,7 @@ function user_uid_only_optional_to_arg($arg) { * An optional user ID of the user to load. If not provided, the current * user's ID will be used. * @return - * A fully-loaded $user object upon successful user load, FALSE if user + * A fully-loaded $user object upon successful user load, NULL if user * cannot be loaded. * * @see user_load() @@ -1866,7 +1866,7 @@ function user_roles($membersonly = FALSE, $permission = NULL) { * A string representing the role ID. * * @return - * A fully-loaded role object if a role with the given ID exists, or FALSE + * A fully-loaded role object if a role with the given ID exists, or NULL * otherwise. */ function user_role_load($rid) {