diff -u b/core/core.api.php b/core/core.api.php
--- b/core/core.api.php
+++ b/core/core.api.php
@@ -2441,8 +2441,8 @@
* @code
* array('#type' => 'status_messages')
* @endcode
- * to a render array, use \Drupal::service('renderer')->render() to render it,
- * and add a command to place the messages in an appropriate location.
+ * to a render array, use drupal_render() to render it, and add a command to
+ * place the messages in an appropriate location.
*
* @section sec_other Other methods for triggering Ajax
* Here are some additional methods you can use to trigger Ajax responses in
@@ -2465,8 +2465,8 @@
* @code
* array('#type' => 'status_messages')
* @endcode
- * to a render array, use drupal_render() to render it, and add a command to
- * place the messages in an appropriate location.
+ * to a render array, use \Drupal::service('renderer')->render() to render it,
+ * and add a command to place the messages in an appropriate location.
*
* @section sec_other Other methods for triggering Ajax
* Here are some additional methods you can use to trigger Ajax responses in
diff -u b/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php
--- b/core/lib/Drupal/Core/Entity/entity.api.php
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -1269,7 +1269,8 @@
* @param &$build
* A renderable array representing the entity content. The module may add
* elements to $build prior to rendering. The structure of $build is a
- * renderable array as expected by \Drupal::service('renderer')->render().
+ * renderable array as expected by
+ * \Drupal\Core\Render\RendererInterface::render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
@@ -1301,7 +1302,8 @@
* @param &$build
* A renderable array representing the entity content. The module may add
* elements to $build prior to rendering. The structure of $build is a
- * renderable array as expected by \Drupal::service('renderer')->render().
+ * renderable array as expected by
+ * \Drupal\Core\Render\RendererInterface::render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
diff -u b/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php
--- b/core/modules/aggregator/src/Controller/AggregatorController.php
+++ b/core/modules/aggregator/src/Controller/AggregatorController.php
@@ -44,7 +44,8 @@
* Presents the aggregator feed creation form.
*
* @return array
- * A form array as expected by \Drupal::service('renderer')->render().
+ * A form array as expected by
+ * \Drupal\Core\Render\RendererInterface::render().
*/
public function feedAdd() {
$feed = $this->entityManager()->getStorage('aggregator_feed')
@@ -104,7 +105,7 @@
* Displays the aggregator administration page.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function adminOverview() {
$entity_manager = $this->entityManager();
diff -u b/core/modules/block/src/Controller/BlockListController.php b/core/modules/block/src/Controller/BlockListController.php
--- b/core/modules/block/src/Controller/BlockListController.php
+++ b/core/modules/block/src/Controller/BlockListController.php
@@ -48,7 +48,7 @@
* The current request.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function listing($theme = NULL, Request $request = NULL) {
$theme = $theme ?: $this->config('system.theme')->get('default');
diff -u b/core/modules/block_content/src/Controller/BlockContentController.php b/core/modules/block_content/src/Controller/BlockContentController.php
--- b/core/modules/block_content/src/Controller/BlockContentController.php
+++ b/core/modules/block_content/src/Controller/BlockContentController.php
@@ -98,7 +98,8 @@
* The current request object.
*
* @return array
- * A form array as expected by \Drupal::service('renderer')->render().
+ * A form array as expected by
+ * \Drupal\Core\Render\RendererInterface::render().
*/
public function addForm(BlockContentTypeInterface $block_content_type, Request $request) {
$block = $this->blockContentStorage->create([
diff -u b/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
--- b/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -504,8 +504,7 @@
$build = [];
if ($items) {
- // Make sure \Drupal::service('renderer')->render() does not re-order the
- // links.
+ // Make sure drupal_render() does not re-order the links.
$build['#sorted'] = TRUE;
// Get the book id from the last link.
$item = end($items);
@@ -519,7 +518,8 @@
$build = [];
if ($items) {
- // Make sure drupal_render() does not re-order the links.
+ // Make sure \Drupal::service('renderer')->render() does not re-order the
+ // links.
$build['#sorted'] = TRUE;
// Get the book id from the last link.
$item = end($items);
diff -u b/core/modules/book/src/BookManagerInterface.php b/core/modules/book/src/BookManagerInterface.php
--- b/core/modules/book/src/BookManagerInterface.php
+++ b/core/modules/book/src/BookManagerInterface.php
@@ -247,8 +247,7 @@
* A data structure representing the tree as returned from buildBookOutlineData.
*
* @return array
- * A structured array to be rendered by
- * \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @see \Drupal\Core\Menu\MenuLinkTree::build
*/
diff -u b/core/modules/comment/comment.module b/core/modules/comment/comment.module
--- b/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -285,12 +285,12 @@
* Defaults to NULL.
*
* @return array
- * An array in the format expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @deprecated in Drupal 8.x and will be removed before Drupal 9.0.
* Use \Drupal::entityManager()->getViewBuilder('comment')->viewMultiple().
*
- * @see \Drupal::service('renderer')->render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
*/
function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
return entity_view_multiple($comments, $view_mode, $langcode);
@@ -552,7 +552,7 @@
* The current state of the form.
*
* @return array
- * An array as expected by drupal_render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render()
*/
function comment_preview(CommentInterface $comment, FormStateInterface $form_state) {
$preview_build = [];
@@ -565,7 +565,7 @@
* The current state of the form.
*
* @return array
- * An array as expected by \Drupal\Core\Render\RendererInterface::render()
+ * An array as expected by drupal_render().
*/
function comment_preview(CommentInterface $comment, FormStateInterface $form_state) {
$preview_build = [];
diff -u b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
--- b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
+++ b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
@@ -45,7 +45,7 @@
* The name of the mapper.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Throws an exception if a mapper plugin could not be instantiated from the
diff -u b/core/modules/contact/src/Controller/ContactController.php b/core/modules/contact/src/Controller/ContactController.php
--- b/core/modules/contact/src/Controller/ContactController.php
+++ b/core/modules/contact/src/Controller/ContactController.php
@@ -48,7 +48,7 @@
*
* @return array
* The form as render array as expected by
- * \Drupal::service('renderer')->render().
+ * \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Exception is thrown when user tries to access non existing default
@@ -96,7 +96,7 @@
*
* @return array
* The personal contact form as render array as expected by
- * \Drupal::service('renderer')->render().
+ * \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Exception is thrown when user tries to access a contact form for a
diff -u b/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
--- b/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -113,7 +113,7 @@
* Full-length messages can be viewed on the message details page.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @see Drupal\dblog\Form\DblogClearLogConfirmForm
* @see Drupal\dblog\Controller\DbLogController::eventDetails()
@@ -233,7 +233,7 @@
*
* @return array
* If the ID is located in the Database Logging table, a build array in the
- * format expected by \Drupal::service('renderer')->render();
+ * format expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function eventDetails($event_id) {
$build = [];
@@ -374,8 +374,7 @@
* Type of database log events to display (e.g., 'search').
*
* @return array
- * A build array in the format expected by
- * \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function topLogMessages($type) {
$header = [
diff -u b/core/modules/field_ui/src/Controller/FieldConfigListController.php b/core/modules/field_ui/src/Controller/FieldConfigListController.php
--- b/core/modules/field_ui/src/Controller/FieldConfigListController.php
+++ b/core/modules/field_ui/src/Controller/FieldConfigListController.php
@@ -21,7 +21,7 @@
* The current route match.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function listing($entity_type_id = NULL, $bundle = NULL, RouteMatchInterface $route_match = NULL) {
return $this->entityManager()->getListBuilder('field_config')->render($entity_type_id, $bundle);
diff -u b/core/modules/field_ui/src/Element/FieldUiTable.php b/core/modules/field_ui/src/Element/FieldUiTable.php
--- b/core/modules/field_ui/src/Element/FieldUiTable.php
+++ b/core/modules/field_ui/src/Element/FieldUiTable.php
@@ -38,7 +38,7 @@
* @return array
* The $element with prepared variables ready for field-ui-table.html.twig.
*
- * @see \Drupal::service('renderer')->render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
* @see \Drupal\Core\Render\Element\Table::preRenderTable()
*/
public static function tablePreRender($elements) {
diff -u b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
--- b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
@@ -702,7 +702,7 @@
*
* @return array
*
- * @see \Drupal::service('renderer')->render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
* @see \Drupal\Core\Render\Element\Table::preRenderTable()
*
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
diff -u b/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php
--- b/core/modules/help/src/Controller/HelpController.php
+++ b/core/modules/help/src/Controller/HelpController.php
@@ -107,7 +107,7 @@
* A module name to display a help page for.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
diff -u b/core/modules/node/node.module b/core/modules/node/node.module
--- b/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -794,15 +794,15 @@
* the global content language of the current request.
*
* @return array
- * An array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
return entity_view($node, $view_mode, $langcode);
}
/**
- * Constructs a \Drupal::service('renderer')->render() style array from an
- * array of loaded nodes.
+ * Constructs a \Drupal\Core\Render\RendererInterface::render() style array from
+ * an array of loaded nodes.
*
* @param $nodes
* An array of nodes as returned by Node::loadMultiple().
@@ -813,7 +813,7 @@
* content language of the current request.
*
* @return array
- * An array in the format expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) {
return entity_view_multiple($nodes, $view_mode, $langcode);
diff -u b/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php
--- b/core/modules/node/src/Controller/NodeController.php
+++ b/core/modules/node/src/Controller/NodeController.php
@@ -122,7 +122,7 @@
* The node revision ID.
*
* @return array
- * An array suitable for \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function revisionShow($node_revision) {
$node = $this->entityManager()->getStorage('node')->loadRevision($node_revision);
@@ -154,7 +154,7 @@
* A node object.
*
* @return array
- * An array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function revisionOverview(NodeInterface $node) {
$account = $this->currentUser();
diff -u b/core/modules/path/src/Controller/PathController.php b/core/modules/path/src/Controller/PathController.php
--- b/core/modules/path/src/Controller/PathController.php
+++ b/core/modules/path/src/Controller/PathController.php
@@ -59,7 +59,7 @@
* The request object.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function adminOverview(Request $request) {
$keys = $request->query->get('search');
diff -u b/core/modules/system/src/SystemManager.php b/core/modules/system/src/SystemManager.php
--- b/core/modules/system/src/SystemManager.php
+++ b/core/modules/system/src/SystemManager.php
@@ -152,7 +152,7 @@
* hidden, so we supply the contents of the block.
*
* @return array
- * A render array suitable for \Drupal::service('renderer')->render.
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function getBlockContents() {
// We hard-code the menu name here since otherwise a link in the tools menu
diff -u b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
--- b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
+++ b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
@@ -15,7 +15,7 @@
* Renders a page with a title.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render()
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function renderTitle() {
$build = [];
@@ -29,7 +29,7 @@
* Renders a page.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function staticTitle() {
$build = [];
@@ -52,7 +52,7 @@
* Defines a controller with a cached render array.
*
* @return array
- * A render array
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function controllerWithCache() {
$build = [];
@@ -66,7 +66,7 @@
* Returns a generic page render array for title tests.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render()
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function renderPage() {
return [
@@ -95,7 +95,7 @@
* Renders a page with encoded markup.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render()
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function renderEncodedMarkup() {
return ['#plain_text' => 'Bad html '];
@@ -105,7 +105,7 @@
* Renders a page with pipe character in link test.
*
* @return array
- * A render array as expected by \Drupal::service('renderer')->render()
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function renderPipeInLink() {
return ['#markup' => 'foo|bar|baz'];
diff -u b/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
--- b/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -195,15 +195,16 @@
* content language of the current request.
*
* @return array
- * A $page element suitable for use by \Drupal::service('renderer')->render().
+ * A $page array as expected by
+ * \Drupal\Core\Render\RendererInterface::render().
*/
function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
return entity_view($term, $view_mode, $langcode);
}
/**
- * Constructs a \Drupal::service('renderer')->render() style array from an
- * array of loaded terms.
+ * Constructs a \Drupal\Core\Render\RendererInterface::render() style array from
+ * an array of loaded terms.
*
* @param array $terms
* An array of taxonomy terms as returned by Term::loadMultiple().
@@ -214,7 +215,7 @@
* content language of the current request.
*
* @return array
- * An array in the format expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function taxonomy_term_view_multiple(array $terms, $view_mode = 'full', $langcode = NULL) {
return entity_view_multiple($terms, $view_mode, $langcode);
diff -u b/core/modules/toolbar/src/Element/Toolbar.php b/core/modules/toolbar/src/Element/Toolbar.php
--- b/core/modules/toolbar/src/Element/Toolbar.php
+++ b/core/modules/toolbar/src/Element/Toolbar.php
@@ -51,7 +51,7 @@
/**
* Builds the Toolbar as a structured array ready for
- * \Drupal::service('renderer')->render().
+ * \Drupal\Core\Render\RendererInterface::render().
*
* Since building the toolbar takes some time, it is done just prior to
* rendering to ensure that it is built only if it will be displayed.
diff -u b/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
--- b/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -217,7 +217,7 @@
* @return array
* The updated renderable array.
*
- * @see \Drupal::service('renderer')->render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
*/
function toolbar_prerender_toolbar_administration_tray(array $element) {
$menu_tree = \Drupal::service('toolbar.menu_tree');
diff -u b/core/modules/user/user.module b/core/modules/user/user.module
--- b/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -893,7 +893,7 @@
* content language of the current request.
*
* @return array
- * An array as expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function user_view($account, $view_mode = 'full', $langcode = NULL) {
return entity_view($account, $view_mode, $langcode);
@@ -912,7 +912,7 @@
* content language of the current request.
*
* @return array
- * An array in the format expected by \Drupal::service('renderer')->render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function user_view_multiple($accounts, $view_mode = 'full', $langcode = NULL) {
return entity_view_multiple($accounts, $view_mode, $langcode);
diff -u b/core/modules/views/views.module b/core/modules/views/views.module
--- b/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -321,9 +321,10 @@
*
* @param $render_element
* The renderable array to which contextual links will be added. This array
- * should be suitable for passing in to \Drupal::service('renderer')->render()
- * and will normally contain a representation of the view display whose
- * contextual links are being requested.
+ * should be suitable for passing in to
+ * \Drupal\Core\Render\RendererInterface::render() and will normally contain a
+ * representation of the view display whose contextual links are being
+ * requested.
* @param $location
* The location in which the calling function intends to render the view and
* its contextual links. The core system supports three options for this
diff -u b/core/tests/Drupal/Tests/EntityViewTrait.php b/core/tests/Drupal/Tests/EntityViewTrait.php
--- b/core/tests/Drupal/Tests/EntityViewTrait.php
+++ b/core/tests/Drupal/Tests/EntityViewTrait.php
@@ -32,7 +32,7 @@
* (optional) Whether to clear the cache for this entity.
* @return array
*
- * @see \Drupal::service('renderer')->render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
*/
protected function buildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
$ensure_fully_built = function(&$elements) use (&$ensure_fully_built) {