diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 6abe08a..4e66460 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2860,6 +2860,11 @@ function drupal_classloader() { */ function drupal_classloader_register($name, $path) { $loader = drupal_classloader(); + + // Convert the namespace component from lowercase_underscore into + // UpperCamelCase to follow common best practices for class naming in PHP. + $name = Symfony\Component\DependencyInjection\Container::camelize($name); + $loader->registerNamespace('Drupal\\' . $name, DRUPAL_ROOT . '/' . $path . '/lib'); } diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc index 80a0770..e1b7152 100644 --- a/core/modules/book/book.admin.inc +++ b/core/modules/book/book.admin.inc @@ -5,7 +5,7 @@ * Admin page callbacks for the book module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Page callback: Returns an administrative overview of all books. @@ -68,7 +68,7 @@ function book_admin_settings_validate($form, &$form_state) { /** * Form constructor for administering a single book's hierarchy. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node of the top-level page in the book. * * @see book_menu() @@ -149,7 +149,7 @@ function book_admin_edit_submit($form, &$form_state) { /** * Builds the table portion of the form for the book administration page. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node of the top-level page in the book. * @param $form * The form that is being modified. diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 44de175..57701f4 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -5,7 +5,7 @@ * Allows users to create and organize related content in an outline. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). @@ -88,7 +88,7 @@ function book_permission() { /** * Adds relevant book links to the node's links. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The book page node to add links to. * @param $view_mode * The view mode of the node. @@ -203,7 +203,7 @@ function book_menu() { * - admin/content/book/%node * - node/%node/outline * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node whose outline tab is to be viewed. * * @see book_menu() @@ -215,7 +215,7 @@ function _book_outline_access(Node $node) { /** * Access callback: Determines if the user can remove nodes from the outline. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to remove from the outline. * * @see book_menu() @@ -522,7 +522,7 @@ function _book_parent_select($book_link) { /** * Builds the common elements of the book form for the node and outline forms. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node whose form is being viewed. */ function _book_add_form_elements(&$form, &$form_state, Node $node) { @@ -627,7 +627,7 @@ function book_form_update($form, $form_state) { * outline through node addition, node editing, node deletion, or the outline * tab. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being saved, added, deleted, or moved. * * @return @@ -1289,7 +1289,7 @@ function book_export_traverse($tree, $visit_func) { /** * Generates printer-friendly HTML for a node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that will be output. * @param $children * All the rendered child nodes within the current node. diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc index aedde16..4278560 100644 --- a/core/modules/book/book.pages.inc +++ b/core/modules/book/book.pages.inc @@ -5,7 +5,7 @@ * User page callbacks for the book module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Page callback: Prints a listing of all books. @@ -95,7 +95,7 @@ function book_export_html($nid) { /** * Page callback: Shows the outline form for a single node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The book node for which to show the outline. * * @see book_menu() @@ -110,7 +110,7 @@ function book_outline(Node $node) { * * Allows handling of all book outline operations via the outline tab. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The book node for which to show the outline. * * @see book_outline_form_submit() @@ -199,7 +199,7 @@ function book_outline_form_submit($form, &$form_state) { /** * Form constructor to confirm removal of a node from a book. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to delete. * * @see book_remove_form_submit() diff --git a/core/modules/book/book.test b/core/modules/book/book.test index f7d8280..1e0cd83 100644 --- a/core/modules/book/book.test +++ b/core/modules/book/book.test @@ -5,7 +5,7 @@ * Tests for book.module. */ -use Drupal\node\Node; +use Drupal\Node\Node; class BookTestCase extends DrupalWebTestCase { protected $book; diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 0302913..0448bb3 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -9,7 +9,7 @@ * book page, etc. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Comment is awaiting approval. @@ -547,7 +547,7 @@ function comment_get_recent($number = 10) { * Number of comments. * @param $new_replies * Number of new replies. - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The first new comment node. * * @return @@ -739,7 +739,7 @@ function comment_node_view(Node $node, $view_mode) { /** * Builds the comment-related elements for node detail pages. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity for which to build the comment-related elements. * * @return @@ -785,7 +785,7 @@ function comment_node_page_additions(Node $node) { /** * Retrieves comments for a thread. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node whose comment(s) needs rendering. * @param $mode * The comment display mode; COMMENT_MODE_FLAT or COMMENT_MODE_THREADED. @@ -938,7 +938,7 @@ function comment_prepare_thread(&$comments) { * * @param Comment $comment * The comment object. - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node the comment is attached to. * @param $view_mode * View mode, e.g. 'full', 'teaser'... @@ -1008,7 +1008,7 @@ function comment_view(Comment $comment, Node $node, $view_mode = 'full', $langco * * @param Comment $comment * A comment object. - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node the comment is attached to. * @param $view_mode * View mode, e.g. 'full', 'teaser'... @@ -1052,7 +1052,7 @@ function comment_build_content(Comment $comment, Node $node, $view_mode = 'full' * * @param Comment $comment * The comment object. - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node the comment is attached to. * * @return @@ -1113,7 +1113,7 @@ function comment_links(Comment $comment, Node $node) { * * @param $comments * An array of comments as returned by comment_load_multiple(). - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node the comments are attached to. * @param $view_mode * View mode, e.g. 'full', 'teaser'... diff --git a/core/modules/comment/comment.pages.inc b/core/modules/comment/comment.pages.inc index bac078b..801bfbf 100644 --- a/core/modules/comment/comment.pages.inc +++ b/core/modules/comment/comment.pages.inc @@ -5,7 +5,7 @@ * User page callbacks for the Comment module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Form constructor for the comment reply form. @@ -19,7 +19,7 @@ use Drupal\node\Node; * The node or comment that is being replied to must appear above the comment * form to provide the user context while authoring the comment. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * Every comment belongs to a node. This is that node. * @param $pid * (optional) Some comments are replies to other comments. In those cases, diff --git a/core/modules/field_ui/field_ui.test b/core/modules/field_ui/field_ui.test index fb71c5d..c84e632 100644 --- a/core/modules/field_ui/field_ui.test +++ b/core/modules/field_ui/field_ui.test @@ -5,7 +5,7 @@ * Tests for field_ui.module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Provides common functionality for the Field UI test classes. diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 2d7313f..748cc58 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -5,7 +5,7 @@ * Provides discussion forums. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). @@ -246,7 +246,7 @@ function forum_uri($forum) { /** * Check whether a content type can be used in a forum. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * * @return diff --git a/core/modules/forum/forum.test b/core/modules/forum/forum.test index 135f551..ce2bf5a 100644 --- a/core/modules/forum/forum.test +++ b/core/modules/forum/forum.test @@ -5,7 +5,7 @@ * Tests for forum.module. */ -use Drupal\node\Node; +use Drupal\Node\Node; class ForumTestCase extends DrupalWebTestCase { protected $admin_user; diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 5d55d06..a3bd694 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -11,7 +11,7 @@ * URLs to be added to the main site navigation menu. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Maximum length of menu name as entered by the user. Database length is 32 diff --git a/core/modules/node/lib/Drupal/node/Node.php b/core/modules/node/lib/Drupal/Node/Node.php similarity index 99% rename from core/modules/node/lib/Drupal/node/Node.php rename to core/modules/node/lib/Drupal/Node/Node.php index 787358e..91cf26f 100644 --- a/core/modules/node/lib/Drupal/node/Node.php +++ b/core/modules/node/lib/Drupal/Node/Node.php @@ -5,7 +5,7 @@ * Entity class for nodes. */ -namespace Drupal\node; +namespace Drupal\Node; use Entity; diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/Node/NodeStorageController.php similarity index 99% rename from core/modules/node/lib/Drupal/node/NodeStorageController.php rename to core/modules/node/lib/Drupal/Node/NodeStorageController.php index 0cdca80..0c8a822 100644 --- a/core/modules/node/lib/Drupal/node/NodeStorageController.php +++ b/core/modules/node/lib/Drupal/Node/NodeStorageController.php @@ -5,7 +5,7 @@ * Entity controller class for nodes. */ -namespace Drupal\node; +namespace Drupal\Node; use EntityDatabaseStorageController; use EntityInterface; diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index 2511ce5..7ddf7a2 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -253,7 +253,7 @@ function hook_node_grants($account, $op) { * * Note: a deny all grant is not written to the database; denies are implicit. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that has just been saved. * * @return @@ -262,7 +262,7 @@ function hook_node_grants($account, $op) { * @see _node_access_write_grants() * @ingroup node_access */ -function hook_node_access_records(Drupal\node\Node $node) { +function hook_node_access_records(Drupal\Node\Node $node) { // We only care about the node if it has been marked private. If not, it is // treated just like any other node and we completely ignore it. if ($node->private) { @@ -313,7 +313,7 @@ function hook_node_access_records(Drupal\node\Node $node) { * * @param $grants * The $grants array returned by hook_node_access_records(). - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node for which the grants were acquired. * * The preferred use of this hook is in a module that bridges multiple node @@ -325,7 +325,7 @@ function hook_node_access_records(Drupal\node\Node $node) { * @see hook_node_grants_alter() * @ingroup node_access */ -function hook_node_access_records_alter(&$grants, Drupal\node\Node $node) { +function hook_node_access_records_alter(&$grants, Drupal\Node\Node $node) { // Our module allows editors to mark specific articles with the 'is_preview' // field. If the node being saved has a TRUE value for that field, then only // our grants are retained, and other grants are removed. Doing so ensures @@ -456,14 +456,14 @@ function hook_node_operations() { * field_attach_delete() are called, and before the node is removed from the * node table in the database. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is about to be deleted. * * @see hook_node_predelete() * @see node_delete_multiple() * @ingroup node_api_hooks */ -function hook_node_predelete(Drupal\node\Node $node) { +function hook_node_predelete(Drupal\Node\Node $node) { db_delete('mytable') ->condition('nid', $node->nid) ->execute(); @@ -475,14 +475,14 @@ function hook_node_predelete(Drupal\node\Node $node) { * This hook is invoked from node_delete_multiple() after field_attach_delete() * has been called and after the node has been removed from the database. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that has been deleted. * * @see hook_node_predelete() * @see node_delete_multiple() * @ingroup node_api_hooks */ -function hook_node_delete(Drupal\node\Node $node) { +function hook_node_delete(Drupal\Node\Node $node) { drupal_set_message(t('Node: @title has been deleted', array('@title' => $node->title))); } @@ -493,12 +493,12 @@ function hook_node_delete(Drupal\node\Node $node) { * removed from the node_revision table, and before * field_attach_delete_revision() is called. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node revision (node object) that is being deleted. * * @ingroup node_api_hooks */ -function hook_node_revision_delete(Drupal\node\Node $node) { +function hook_node_revision_delete(Drupal\Node\Node $node) { db_delete('mytable') ->condition('vid', $node->vid) ->execute(); @@ -511,12 +511,12 @@ function hook_node_revision_delete(Drupal\node\Node $node) { * node table in the database, after the type-specific hook_insert() is invoked, * and after field_attach_insert() is called. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being created. * * @ingroup node_api_hooks */ -function hook_node_insert(Drupal\node\Node $node) { +function hook_node_insert(Drupal\Node\Node $node) { db_insert('mytable') ->fields(array( 'nid' => $node->nid, @@ -583,7 +583,7 @@ function hook_node_load($nodes, $types) { * the default home page at path 'node', a recent content block, etc.) See * @link node_access Node access rights @endlink for a full explanation. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * Either a node entity or the machine name of the content type on which to * perform the access check. * @param string $op @@ -634,12 +634,12 @@ function hook_node_access($node, $op, $account) { * This hook is invoked from node_object_prepare() after the type-specific * hook_prepare() is invoked. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is about to be shown on the add/edit form. * * @ingroup node_api_hooks */ -function hook_node_prepare(Drupal\node\Node $node) { +function hook_node_prepare(Drupal\Node\Node $node) { if (!isset($node->comment)) { $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN); } @@ -651,7 +651,7 @@ function hook_node_prepare(Drupal\node\Node $node) { * This hook is invoked from node_search_execute(), after node_load() * and node_view() have been called. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node being displayed in a search result. * * @return array @@ -665,7 +665,7 @@ function hook_node_prepare(Drupal\node\Node $node) { * * @ingroup node_api_hooks */ -function hook_node_search_result(Drupal\node\Node $node) { +function hook_node_search_result(Drupal\Node\Node $node) { $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField(); return array('comment' => format_plural($comments, '1 comment', '@count comments')); } @@ -676,12 +676,12 @@ function hook_node_search_result(Drupal\node\Node $node) { * This hook is invoked from node_save() before the node is saved to the * database. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being inserted or updated. * * @ingroup node_api_hooks */ -function hook_node_presave(Drupal\node\Node $node) { +function hook_node_presave(Drupal\Node\Node $node) { if ($node->nid && $node->moderate) { // Reset votes when node is updated: $node->score = 0; @@ -697,12 +697,12 @@ function hook_node_presave(Drupal\node\Node $node) { * table in the database, after the type-specific hook_update() is invoked, and * after field_attach_update() is called. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being updated. * * @ingroup node_api_hooks */ -function hook_node_update(Drupal\node\Node $node) { +function hook_node_update(Drupal\Node\Node $node) { db_update('mytable') ->fields(array('extra' => $node->extra)) ->condition('nid', $node->nid) @@ -715,7 +715,7 @@ function hook_node_update(Drupal\node\Node $node) { * This hook is invoked during search indexing, after node_load(), and after * the result of node_view() is added as $node->rendered to the node object. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node being indexed. * * @return string @@ -723,7 +723,7 @@ function hook_node_update(Drupal\node\Node $node) { * * @ingroup node_api_hooks */ -function hook_node_update_index(Drupal\node\Node $node) { +function hook_node_update_index(Drupal\Node\Node $node) { $text = ''; $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED)); foreach ($comments as $comment) { @@ -747,7 +747,7 @@ function hook_node_update_index(Drupal\node\Node $node) { * hook_node_presave() instead. If it is really necessary to change * the node at the validate stage, you can use form_set_value(). * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node being validated. * @param $form * The form being used to edit the node. @@ -756,7 +756,7 @@ function hook_node_update_index(Drupal\node\Node $node) { * * @ingroup node_api_hooks */ -function hook_node_validate(Drupal\node\Node $node, $form, &$form_state) { +function hook_node_validate(Drupal\Node\Node $node, $form, &$form_state) { if (isset($node->end) && isset($node->start)) { if ($node->start > $node->end) { form_set_error('time', t('An event may not end before it starts.')); @@ -775,7 +775,7 @@ function hook_node_validate(Drupal\node\Node $node, $form, &$form_state) { * properties. See hook_field_attach_submit() for customizing field-related * properties. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity being updated in response to a form submission. * @param $form * The form being used to edit the node. @@ -784,7 +784,7 @@ function hook_node_validate(Drupal\node\Node $node, $form, &$form_state) { * * @ingroup node_api_hooks */ -function hook_node_submit(Drupal\node\Node $node, $form, &$form_state) { +function hook_node_submit(Drupal\Node\Node $node, $form, &$form_state) { // Decompose the selected menu parent option into 'menu_name' and 'plid', if // the form used the default parent selection widget. if (!empty($form_state['values']['menu']['parent'])) { @@ -804,7 +804,7 @@ function hook_node_submit(Drupal\node\Node $node, $form, &$form_state) { * the RSS item generated for this node. * For details on how this is used, see node_feed(). * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being assembled for rendering. * @param $view_mode * The $view_mode parameter from node_view(). @@ -817,7 +817,7 @@ function hook_node_submit(Drupal\node\Node $node, $form, &$form_state) { * * @ingroup node_api_hooks */ -function hook_node_view(Drupal\node\Node $node, $view_mode, $langcode) { +function hook_node_view(Drupal\Node\Node $node, $view_mode, $langcode) { $node->content['my_additional_field'] = array( '#markup' => $additional_field, '#weight' => 10, @@ -1027,12 +1027,12 @@ function hook_node_type_delete($info) { * removed from the node table in the database, before hook_node_delete() is * invoked, and before field_attach_delete() is called. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being deleted. * * @ingroup node_api_hooks */ -function hook_delete(Drupal\node\Node $node) { +function hook_delete(Drupal\Node\Node $node) { db_delete('mytable') ->condition('nid', $node->nid) ->execute(); @@ -1047,12 +1047,12 @@ function hook_delete(Drupal\node\Node $node) { * This hook is invoked from node_object_prepare() before the general * hook_node_prepare() is invoked. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is about to be shown on the add/edit form. * * @ingroup node_api_hooks */ -function hook_prepare(Drupal\node\Node $node) { +function hook_prepare(Drupal\Node\Node $node) { if ($file = file_check_upload($field_name)) { $file = file_save_upload($field_name, _image_filename($file->filename, NULL, TRUE)); if ($file) { @@ -1083,7 +1083,7 @@ function hook_prepare(Drupal\node\Node $node) { * displayed automatically by the node module. This hook just needs to * return the node title and form editing fields specific to the node type. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node being added or edited. * @param $form_state * The form state array. @@ -1094,7 +1094,7 @@ function hook_prepare(Drupal\node\Node $node) { * * @ingroup node_api_hooks */ -function hook_form(Drupal\node\Node $node, &$form_state) { +function hook_form(Drupal\Node\Node $node, &$form_state) { $type = node_type_get_type($node); $form['title'] = array( @@ -1135,12 +1135,12 @@ function hook_form(Drupal\node\Node $node, &$form_state) { * node table in the database, before field_attach_insert() is called, and * before hook_node_insert() is invoked. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being created. * * @ingroup node_api_hooks */ -function hook_insert(Drupal\node\Node $node) { +function hook_insert(Drupal\Node\Node $node) { db_insert('mytable') ->fields(array( 'nid' => $node->nid, @@ -1193,12 +1193,12 @@ function hook_load($nodes) { * node table in the database, before field_attach_update() is called, and * before hook_node_update() is invoked. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node that is being updated. * * @ingroup node_api_hooks */ -function hook_update(Drupal\node\Node $node) { +function hook_update(Drupal\Node\Node $node) { db_update('mytable') ->fields(array('extra' => $node->extra)) ->condition('nid', $node->nid) @@ -1222,7 +1222,7 @@ function hook_update(Drupal\node\Node $node) { * have no effect. The preferred method to change a node's content is to use * hook_node_presave() instead. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node being validated. * @param $form * The form being used to edit the node. @@ -1231,7 +1231,7 @@ function hook_update(Drupal\node\Node $node) { * * @ingroup node_api_hooks */ -function hook_validate(Drupal\node\Node $node, $form, &$form_state) { +function hook_validate(Drupal\Node\Node $node, $form, &$form_state) { if (isset($node->end) && isset($node->start)) { if ($node->start > $node->end) { form_set_error('time', t('An event may not end before it starts.')); @@ -1249,7 +1249,7 @@ function hook_validate(Drupal\node\Node $node, $form, &$form_state) { * so that the node type module can define a custom method for display, or * add to the default display. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to be displayed, as returned by node_load(). * @param $view_mode * View mode, e.g. 'full', 'teaser', ... @@ -1268,7 +1268,7 @@ function hook_validate(Drupal\node\Node $node, $form, &$form_state) { * * @ingroup node_api_hooks */ -function hook_view(Drupal\node\Node $node, $view_mode) { +function hook_view(Drupal\Node\Node $node, $view_mode) { if ($view_mode == 'full' && node_is_page($node)) { $breadcrumb = array(); $breadcrumb[] = l(t('Home'), NULL); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 5e1c3b3..0710aa2 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -3,7 +3,7 @@ use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Database\Query\SelectExtender; use Drupal\Core\Database\Query\SelectInterface; -use Drupal\node\Node; +use Drupal\Node\Node; /** * @file @@ -184,8 +184,8 @@ function node_entity_info() { $return = array( 'node' => array( 'label' => t('Node'), - 'controller class' => 'Drupal\node\NodeStorageController', - 'entity class' => 'Drupal\node\Node', + 'controller class' => 'Drupal\Node\NodeStorageController', + 'entity class' => 'Drupal\Node\Node', 'base table' => 'node', 'revision table' => 'node_revision', 'uri callback' => 'node_uri', @@ -263,7 +263,7 @@ function node_field_display_node_alter(&$display, $context) { /** * Entity uri callback. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. */ function node_uri(Node $node) { @@ -319,7 +319,7 @@ function node_title_list($result, $title = NULL) { /** * Updates the 'last viewed' timestamp of the specified node for current user. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. */ function node_tag_new(Node $node) { @@ -382,7 +382,7 @@ function node_mark($nid, $timestamp) { /** * Extracts the type name. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * Either a string or object, containing the node type information. * * @return @@ -410,7 +410,7 @@ function node_type_get_types() { /** * Returns the node type of the passed node or node type string. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * A node entity or string that indicates the node type to return. * * @return @@ -433,7 +433,7 @@ function node_type_get_type($node) { * execute node-type-specific hooks. For types defined in the user interface * and managed by node.module, the base is 'node_content'. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * A node entity or string that indicates the node type to return. * * @return @@ -463,7 +463,7 @@ function node_type_get_names() { /** * Returns the node type name of the passed node or node type string. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * A node entity or string that indicates the node type to return. * * @return @@ -877,7 +877,7 @@ function node_rdf_mapping() { /** * Determines whether a node hook exists. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * A node entity or a string containing the node type. * @param $hook * A string containing the name of the hook. @@ -893,7 +893,7 @@ function node_hook($node, $hook) { /** * Invokes a node hook. * - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * A node entity or a string containing the node type. * @param $hook * A string containing the name of the hook. @@ -951,7 +951,7 @@ function node_load_multiple($nids = array(), array $conditions = array(), $reset * @param bool $reset * (optional) Whether to reset the node_load_multiple() cache. * - * @return Drupal\node\Node|false + * @return Drupal\Node\Node|false * A fully-populated node entity, or FALSE if the node is not found. */ function node_load($nid = NULL, $vid = NULL, $reset = FALSE) { @@ -967,7 +967,7 @@ function node_load($nid = NULL, $vid = NULL, $reset = FALSE) { * Fills in a few default values, and then invokes hook_prepare() on the node * type module, and hook_node_prepare() on all modules. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. */ function node_object_prepare(Node $node) { @@ -1067,7 +1067,7 @@ function node_submit($node) { /** * Saves changes to a node or adds a new node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The $node entity to be saved. If $node->nid is * omitted (or $node->is_new is TRUE), a new node will be added. */ @@ -1129,7 +1129,7 @@ function node_revision_delete($revision_id) { /** * Generates an array for rendering the given node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $view_mode * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full.' @@ -1194,7 +1194,7 @@ function node_view(Node $node, $view_mode = 'full', $langcode = NULL) { * Contributed modules might define additional view modes, or use existing * view modes in additional contexts. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $view_mode * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full.' @@ -1255,7 +1255,7 @@ function node_build_content(Node $node, $view_mode = 'full', $langcode = NULL) { /** * Page callback: Generates an array which displays a node detail page. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $message * (optional) A flag which sets a page title relevant to the revision being @@ -1283,7 +1283,7 @@ function node_show(Node $node, $message = FALSE) { /** * Checks whether the current page is the full page view of the passed-in node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * * @return @@ -1529,7 +1529,7 @@ function node_search_admin() { */ function node_search_execute($keys = NULL, $conditions = NULL) { // Build matching conditions - $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('Drupal\search\SearchQuery')->extend('PagerDefault'); + $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('Drupal\Search\SearchQuery')->extend('PagerDefault'); $query->join('node', 'n', 'n.nid = i.sid'); $query ->condition('n.status', 1) @@ -1712,7 +1712,7 @@ function theme_node_search_admin($variables) { /** * Access callback: Checks node revision access. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to check. * @param $op * (optional) The specific operation being checked. Defaults to 'view.' @@ -2013,7 +2013,7 @@ function node_type_page_title($type) { /** * Title callback: Displays the node's title. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. * * @see node_menu() @@ -2038,7 +2038,7 @@ function node_last_changed($nid) { /** * Returns a list of all the existing revision numbers for the node passed in. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. */ function node_revision_list(Node $node) { @@ -2546,7 +2546,7 @@ function node_page_default() { /** * Page callback: Displays a single node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. * * @see node_menu() @@ -2584,7 +2584,7 @@ function node_update_index() { /** * Indexes a single node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to index. */ function _node_index_node(Node $node) { @@ -2805,7 +2805,7 @@ function node_form_system_themes_admin_form_submit($form, &$form_state) { * - "update" * - "delete" * - "create" - * @param Drupal\node\Node|string $node + * @param Drupal\Node\Node|string $node * The node entity on which the operation is to be performed, or the node type * (e.g., 'forum') for the 'create' operation. * @param $account @@ -3295,7 +3295,7 @@ function _node_query_node_access_alter($query, $type) { * via hook_node_access_records_alter() implementations, and saves the collected * and altered grants to the database. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The $node to acquire grants for. * @param $delete * (optional) Whether to delete existing node access records before inserting @@ -3323,7 +3323,7 @@ function node_access_acquire_grants(Node $node, $delete = TRUE) { * Note: Don't call this function directly from a contributed module. Call * node_access_acquire_grants() instead. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The $node being written to. All that is necessary is that it contains a * nid. * @param $grants @@ -3639,7 +3639,7 @@ function node_action_info() { /** * Sets the status of a node to 1 (published). * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3655,7 +3655,7 @@ function node_publish_action(Node $node, $context = array()) { /** * Sets the status of a node to 0 (unpublished). * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3671,7 +3671,7 @@ function node_unpublish_action(Node $node, $context = array()) { /** * Sets the sticky-at-top-of-list property of a node to 1. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3687,7 +3687,7 @@ function node_make_sticky_action(Node $node, $context = array()) { /** * Sets the sticky-at-top-of-list property of a node to 0. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3703,7 +3703,7 @@ function node_make_unsticky_action(Node $node, $context = array()) { /** * Sets the promote property of a node to 1. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3719,7 +3719,7 @@ function node_promote_action(Node $node, $context = array()) { /** * Sets the promote property of a node to 0. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * @param $context * (optional) Array of additional information about what triggered the action. @@ -3735,7 +3735,7 @@ function node_unpromote_action(Node $node, $context = array()) { /** * Saves a node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to be saved. * * @ingroup actions @@ -3748,7 +3748,7 @@ function node_save_action(Node $node) { /** * Assigns ownership of a node to a user. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity to modify. * @param $context * Array of additional information about what triggered the action. Includes @@ -3861,7 +3861,7 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) { /** * Unpublishes a node containing certain keywords. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity to modify. * @param $context * Array of additional information about what triggered the action. Includes diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 868acbd..433df40 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -9,7 +9,7 @@ * @see node_menu() */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Page callback: Presents the node editing form. @@ -397,7 +397,7 @@ function node_form_build_preview($form, &$form_state) { /** * Generates a node preview. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node to preview. * * @return diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.module b/core/modules/node/tests/modules/node_access_test/node_access_test.module index cda5fdf..30e4239 100644 --- a/core/modules/node/tests/modules/node_access_test/node_access_test.module +++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module @@ -7,7 +7,7 @@ * a special 'node test view' permission. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_node_grants(). diff --git a/core/modules/node/tests/modules/node_test/node_test.module b/core/modules/node/tests/modules/node_test/node_test.module index f541d10..47f91ab 100644 --- a/core/modules/node/tests/modules/node_test/node_test.module +++ b/core/modules/node/tests/modules/node_test/node_test.module @@ -6,7 +6,7 @@ * the Node module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_node_load(). diff --git a/core/modules/node/tests/modules/node_test_exception/node_test_exception.module b/core/modules/node/tests/modules/node_test_exception/node_test_exception.module index 570236b..00a8e74 100644 --- a/core/modules/node/tests/modules/node_test_exception/node_test_exception.module +++ b/core/modules/node/tests/modules/node_test_exception/node_test_exception.module @@ -6,7 +6,7 @@ * the Node module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_node_insert(). diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 1d638ad..46894bb 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -5,7 +5,7 @@ * Enables users to rename URLs. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). diff --git a/core/modules/poll/poll.module b/core/modules/poll/poll.module index beba2ed..48d85df 100644 --- a/core/modules/poll/poll.module +++ b/core/modules/poll/poll.module @@ -6,7 +6,7 @@ * choice questions. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). @@ -608,7 +608,7 @@ function poll_delete($node) { /** * Return content for 'latest poll' block. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity to load. */ function poll_block_latest_poll_view(Node $node) { diff --git a/core/modules/rdf/rdf.test b/core/modules/rdf/rdf.test index c160ccb..9acf7ec 100644 --- a/core/modules/rdf/rdf.test +++ b/core/modules/rdf/rdf.test @@ -5,7 +5,7 @@ * Tests for rdf.module. */ -use Drupal\node\Node; +use Drupal\Node\Node; class RdfMappingHookTestCase extends DrupalWebTestCase { public static function getInfo() { diff --git a/core/modules/search/lib/Drupal/search/SearchQuery.php b/core/modules/search/lib/Drupal/Search/SearchQuery.php similarity index 99% rename from core/modules/search/lib/Drupal/search/SearchQuery.php rename to core/modules/search/lib/Drupal/Search/SearchQuery.php index 95103a6..4f27bae 100644 --- a/core/modules/search/lib/Drupal/search/SearchQuery.php +++ b/core/modules/search/lib/Drupal/Search/SearchQuery.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\search\SearchQuery. + * Definition of Drupal\Search\SearchQuery. */ -namespace Drupal\search; +namespace Drupal\Search; use Drupal\Core\Database\Query\SelectExtender; use Drupal\Core\Database\StatementEmpty; diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php index cf81922..286d165 100644 --- a/core/modules/search/search.api.php +++ b/core/modules/search/search.api.php @@ -162,7 +162,7 @@ function hook_search_admin() { * * If your module uses hook_update_index() and search_index() to index its * items, use table 'search_index' aliased to 'i' as the main table in your - * query, with the 'Drupal\search\SearchQuery' extension. You can join to your + * query, with the 'Drupal\Search\SearchQuery' extension. You can join to your * module's table using the 'i.sid' field, which will contain the $sid values * you provided to search_index(). Add the main keywords to the query by using * method searchExpression(). The functions search_expression_extract() and @@ -195,7 +195,7 @@ function hook_search_admin() { */ function hook_search_execute($keys = NULL, $conditions = NULL) { // Build matching conditions - $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('Drupal\search\SearchQuery')->extend('PagerDefault'); + $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('Drupal\Search\SearchQuery')->extend('PagerDefault'); $query->join('node', 'n', 'n.nid = i.sid'); $query ->condition('n.status', 1) diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 9a6a11a..c4712db 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -5,7 +5,7 @@ * Enables site-wide keyword searching. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Matches all 'N' Unicode character classes (numbers) diff --git a/core/modules/search/search.test b/core/modules/search/search.test index dd63ec4..f3760eb 100644 --- a/core/modules/search/search.test +++ b/core/modules/search/search.test @@ -159,7 +159,7 @@ class SearchMatchTestCase extends SearchWebTestCase { ); foreach ($queries as $query => $results) { $result = db_select('search_index', 'i') - ->extend('Drupal\search\SearchQuery') + ->extend('Drupal\Search\SearchQuery') ->searchExpression($query, SEARCH_TYPE) ->execute(); @@ -179,7 +179,7 @@ class SearchMatchTestCase extends SearchWebTestCase { ); foreach ($queries as $query => $results) { $result = db_select('search_index', 'i') - ->extend('Drupal\search\SearchQuery') + ->extend('Drupal\Search\SearchQuery') ->searchExpression($query, SEARCH_TYPE_2) ->execute(); @@ -202,7 +202,7 @@ class SearchMatchTestCase extends SearchWebTestCase { ); foreach ($queries as $query => $results) { $result = db_select('search_index', 'i') - ->extend('Drupal\search\SearchQuery') + ->extend('Drupal\Search\SearchQuery') ->searchExpression($query, SEARCH_TYPE_JPN) ->execute(); diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 69d5f5b..e26ecf6 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -5,7 +5,7 @@ * Logs and displays access statistics for a site. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 024f3ed..1573666 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -5,7 +5,7 @@ * Enables the organization of content into categories. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Denotes that no term in the vocabulary has a parent. @@ -1554,7 +1554,7 @@ function taxonomy_node_insert(Node $node) { * The index lists all terms that are related to a given node entity, and is * therefore maintained at the entity level. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. */ function taxonomy_build_node_index($node) { @@ -1637,7 +1637,7 @@ function taxonomy_node_predelete(Node $node) { /** * Deletes taxonomy index entries for a given node. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * The node entity. */ function taxonomy_delete_node_index(Node $node) { diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/Tracker/Tests/TrackerTest.php similarity index 99% rename from core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php rename to core/modules/tracker/lib/Drupal/Tracker/Tests/TrackerTest.php index 5e689ff..7a6e2c5 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php +++ b/core/modules/tracker/lib/Drupal/Tracker/Tests/TrackerTest.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\tracker\Tests\TrackerTest. + * Definition of Drupal\Tracker\Tests\TrackerTest. */ -namespace Drupal\tracker\Tests; +namespace Drupal\Tracker\Tests; use DrupalWebTestCase; diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module index dbedf12..caf143b 100644 --- a/core/modules/tracker/tracker.module +++ b/core/modules/tracker/tracker.module @@ -5,7 +5,7 @@ * Tracks recent content posted by a user or users. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_help(). diff --git a/core/modules/translation/tests/translation_test.module b/core/modules/translation/tests/translation_test.module index 1bd0659..2c942fa 100644 --- a/core/modules/translation/tests/translation_test.module +++ b/core/modules/translation/tests/translation_test.module @@ -5,7 +5,7 @@ * Mock module for content translation tests. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Implements hook_node_insert(). diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index b2c0635..a5ac73a 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -19,7 +19,7 @@ * date (0) or needs to be updated (1). */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Identifies a content type which has translation support enabled. diff --git a/core/modules/translation/translation.pages.inc b/core/modules/translation/translation.pages.inc index d85b5e2..13423fb 100644 --- a/core/modules/translation/translation.pages.inc +++ b/core/modules/translation/translation.pages.inc @@ -5,12 +5,12 @@ * User page callbacks for the Translation module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Page callback: Displays a list of a node's translations. * - * @param Drupal\node\Node $node + * @param Drupal\Node\Node $node * A node entity. * * @return diff --git a/core/modules/translation/translation.test b/core/modules/translation/translation.test index 15a324e..aefb085 100644 --- a/core/modules/translation/translation.test +++ b/core/modules/translation/translation.test @@ -5,7 +5,7 @@ * Tests for the Translation module. */ -use Drupal\node\Node; +use Drupal\Node\Node; /** * Functional tests for the Translation module. diff --git a/core/modules/user/lib/Drupal/user/User.php b/core/modules/user/lib/Drupal/User/User.php similarity index 97% rename from core/modules/user/lib/Drupal/user/User.php rename to core/modules/user/lib/Drupal/User/User.php index b39d88d..12fb30e 100644 --- a/core/modules/user/lib/Drupal/user/User.php +++ b/core/modules/user/lib/Drupal/User/User.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\user\User. + * Definition of Drupal\User\User. */ -namespace Drupal\user; +namespace Drupal\User; /** * @todo Switch to PSR-0 for the Entity classes: http://drupal.org/node/1495024 diff --git a/core/modules/user/lib/Drupal/user/UserStorageController.php b/core/modules/user/lib/Drupal/User/UserStorageController.php similarity index 99% rename from core/modules/user/lib/Drupal/user/UserStorageController.php rename to core/modules/user/lib/Drupal/User/UserStorageController.php index bd0d9b9..e29b9d1 100644 --- a/core/modules/user/lib/Drupal/user/UserStorageController.php +++ b/core/modules/user/lib/Drupal/User/UserStorageController.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\user\UserStorageController. + * Definition of Drupal\User\UserStorageController. */ -namespace Drupal\user; +namespace Drupal\User; /** * @todo Switch to PSR-0 for the Entity classes: http://drupal.org/node/1495024 diff --git a/core/modules/user/user.module b/core/modules/user/user.module index e6fa2dd..81d5ff6 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -144,12 +144,12 @@ function user_entity_info() { return array( 'user' => array( 'label' => t('User'), - 'controller class' => 'Drupal\user\UserStorageController', + 'controller class' => 'Drupal\User\UserStorageController', 'base table' => 'users', 'uri callback' => 'user_uri', 'label callback' => 'user_label', 'fieldable' => TRUE, - 'entity class' => 'Drupal\user\User', + 'entity class' => 'Drupal\User\User', 'entity keys' => array( 'id' => 'uid', ),