Unverified Commit 3bfc5a38 authored by alexpott's avatar alexpott

Issue #2938970 by MerryHamster, surbz, msankhala, alexpott, Jo Fitzgerald,...

Issue #2938970 by MerryHamster, surbz, msankhala, alexpott, Jo Fitzgerald, Yasiru Nilan, Manuel Garcia, ZeiP, boaloysius, xjm, wturrell, tameeshb, darrenwh, ritzz: Replace drupal_render() in @param, @return, @see, @Link, etc
parent 951b4334
......@@ -899,7 +899,7 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) {
* rendering when possible or loop through the elements and render them as
* they are available.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
* @see https://www.drupal.org/node/2912757
*/
function drupal_render_children(&$element, $children_keys = NULL) {
......
......@@ -16,7 +16,8 @@ class EntityListController extends ControllerBase {
* The entity type to render.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function listing($entity_type) {
return $this->entityManager()->getListBuilder($entity_type)->render();
......
......@@ -88,7 +88,8 @@ public function buildTitle(array $page) {
* Defaults to 'full'.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function view(EntityInterface $_entity, $view_mode = 'full') {
$page = $this->entityManager
......
......@@ -47,7 +47,8 @@ public function getOperations(EntityInterface $entity);
* Builds a listing of entities for the given entity type.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function render();
......
......@@ -213,7 +213,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
* @return array
* The updated renderable array.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
*/
public function build(array $build) {
$build_list = [$build];
......@@ -237,7 +237,7 @@ public function build(array $build) {
* @return array
* The updated renderable array.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
*/
public function buildMultiple(array $build_list) {
// Build the view modes and display objects.
......
......@@ -1359,7 +1359,8 @@ function hook_ENTITY_TYPE_revision_delete(Drupal\Core\Entity\EntityInterface $en
* @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_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
......@@ -1391,7 +1392,8 @@ function hook_entity_view(array &$build, \Drupal\Core\Entity\EntityInterface $en
* @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_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
......@@ -1569,7 +1571,7 @@ function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInter
* @param string $view_mode
* The view_mode that is to be used to display the entity.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
* @see \Drupal\Core\Entity\EntityViewBuilder
* @see hook_entity_build_defaults_alter()
*
......@@ -1593,7 +1595,7 @@ function hook_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entit
* @param string $view_mode
* The view_mode that is to be used to display the entity.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
* @see \Drupal\Core\Entity\EntityViewBuilder
* @see hook_ENTITY_TYPE_build_defaults_alter()
*
......
......@@ -44,7 +44,8 @@ public static function create(ContainerInterface $container) {
* Presents the aggregator feed creation form.
*
* @return array
* A form array as expected by drupal_render().
* A form array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function feedAdd() {
$feed = $this->entityManager()->getStorage('aggregator_feed')->create();
......@@ -101,7 +102,8 @@ public function feedRefresh(FeedInterface $aggregator_feed) {
* Displays the aggregator administration page.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function adminOverview() {
$entity_manager = $this->entityManager();
......
......@@ -48,7 +48,8 @@ public static function create(ContainerInterface $container) {
* The current request.
*
* @return array
* A render array as expected by drupal_render().
* A render 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');
......
......@@ -98,7 +98,8 @@ public function add(Request $request) {
* The current request object.
*
* @return array
* A form array as expected by drupal_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([
......
......@@ -246,7 +246,8 @@ public function deleteFromBook($nid);
* A data structure representing the tree as returned from buildBookOutlineData.
*
* @return array
* A structured array to be rendered by drupal_render().
* A structured array to be rendered by
* \Drupal\Core\Render\RendererInterface::render().
*
* @see \Drupal\Core\Menu\MenuLinkTree::build
*/
......
......@@ -268,7 +268,7 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
* content language of the current request.
*
* @return array
* An array as expected by drupal_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')->view().
......@@ -291,12 +291,13 @@ function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode
* Defaults to NULL.
*
* @return array
* An array in the format expected by drupal_render().
* An array in the format 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_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);
......@@ -558,7 +559,7 @@ function comment_user_predelete($account) {
* 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 = [];
......
......@@ -45,7 +45,8 @@ public static function create(ContainerInterface $container) {
* The name of the mapper.
*
* @return array
* A render array as expected by drupal_render().
* A render 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
......
......@@ -47,7 +47,8 @@ public static function create(ContainerInterface $container) {
* The contact form to use.
*
* @return array
* The form as render array as expected by drupal_render().
* The form as render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Exception is thrown when user tries to access non existing default
......@@ -95,7 +96,8 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
* The account for which a personal contact form should be generated.
*
* @return array
* The personal contact form as render array as expected by drupal_render().
* The personal contact form as render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Exception is thrown when user tries to access a contact form for a
......
......@@ -14,7 +14,8 @@ class ModeratedContentController extends ControllerBase {
* Provides the listing page for moderated nodes.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function nodeListing() {
$entity_type = $this->entityTypeManager()->getDefinition('node');
......
......@@ -113,7 +113,8 @@ public static function getLogLevelClassMap() {
* Full-length messages can be viewed on the message details page.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*
* @see Drupal\dblog\Form\DblogClearLogConfirmForm
* @see Drupal\dblog\Controller\DbLogController::eventDetails()
......@@ -237,7 +238,7 @@ public function overview() {
*
* @return array
* If the ID is located in the Database Logging table, a build array in the
* format expected by drupal_render();
* format expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function eventDetails($event_id) {
$build = [];
......@@ -378,7 +379,8 @@ public function formatMessage($row) {
* Type of database log events to display (e.g., 'search').
*
* @return array
* A build array in the format expected by drupal_render().
* A build array in the format expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function topLogMessages($type) {
$header = [
......
......@@ -21,7 +21,8 @@ class FieldConfigListController extends EntityListController {
* The current route match.
*
* @return array
* A render array as expected by drupal_render().
* A render 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);
......
......@@ -38,7 +38,7 @@ public function getInfo() {
* @return array
* The $element with prepared variables ready for field-ui-table.html.twig.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
* @see \Drupal\Core\Render\Element\Table::preRenderTable()
*/
public static function tablePreRender($elements) {
......
......@@ -703,7 +703,7 @@ public function multistepAjax($form, FormStateInterface $form_state) {
*
* @return array
*
* @see drupal_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.
......
......@@ -107,7 +107,8 @@ public function helpMain() {
* A module name to display a help page for.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
......
......@@ -806,7 +806,7 @@ function node_get_recent($number = 10) {
* the global content language of the current request.
*
* @return array
* An array as expected by drupal_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);
......@@ -824,7 +824,8 @@ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
* content language of the current request.
*
* @return array
* An array in the format expected by drupal_render().
* An array in the format 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);
......
......@@ -122,7 +122,7 @@ public function add(NodeTypeInterface $node_type) {
* The node revision ID.
*
* @return array
* An array suitable for drupal_render().
* An array suitable for \Drupal\Core\Render\RendererInterface::render().
*/
public function revisionShow($node_revision) {
$node = $this->entityManager()->getStorage('node')->loadRevision($node_revision);
......@@ -154,7 +154,7 @@ public function revisionPageTitle($node_revision) {
* A node object.
*
* @return array
* An array as expected by drupal_render().
* An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
public function revisionOverview(NodeInterface $node) {
$account = $this->currentUser();
......
......@@ -59,7 +59,8 @@ public static function create(ContainerInterface $container) {
* The request object.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function adminOverview(Request $request) {
$keys = $request->query->get('search');
......
......@@ -152,7 +152,8 @@ public function getMaxSeverity(&$requirements) {
* hidden, so we supply the contents of the block.
*
* @return array
* A render array suitable for drupal_render.
* A render array suitable for
* \Drupal\Core\Render\RendererInterface::render().
*/
public function getBlockContents() {
// We hard-code the menu name here since otherwise a link in the tools menu
......
......@@ -15,7 +15,8 @@ class Test {
* Renders a page with a title.
*
* @return array
* A render array as expected by drupal_render()
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function renderTitle() {
$build = [];
......@@ -29,7 +30,8 @@ public function renderTitle() {
* Renders a page.
*
* @return array
* A render array as expected by drupal_render().
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function staticTitle() {
$build = [];
......@@ -66,7 +68,8 @@ public function controllerWithCache() {
* Returns a generic page render array for title tests.
*
* @return array
* A render array as expected by drupal_render()
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function renderPage() {
return [
......@@ -95,7 +98,8 @@ public function error() {
* Renders a page with encoded markup.
*
* @return array
* A render array as expected by drupal_render()
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function renderEncodedMarkup() {
return ['#plain_text' => 'Bad html <script>alert(123);</script>'];
......@@ -105,7 +109,8 @@ public function renderEncodedMarkup() {
* Renders a page with pipe character in link test.
*
* @return array
* A render array as expected by drupal_render()
* A render array as expected by
* \Drupal\Core\Render\RendererInterface::render().
*/
public function renderPipeInLink() {
return ['#markup' => '<a href="http://example.com">foo|bar|baz</a>'];
......
......@@ -213,7 +213,8 @@ function taxonomy_check_vocabulary_hierarchy(VocabularyInterface $vocabulary, $c
* content language of the current request.
*
* @return array
* A $page element suitable for use by drupal_render().
* A $page element suitable for use by
* \Drupal\Core\Render\RendererInterface::render().
*/
function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
return entity_view($term, $view_mode, $langcode);
......@@ -231,7 +232,8 @@ function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
* content language of the current request.
*
* @return array
* An array in the format expected by drupal_render().
* An array in the format 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);
......
......@@ -217,7 +217,7 @@ function toolbar_toolbar() {
* @return array
* The updated renderable array.
*
* @see drupal_render()
* @see \Drupal\Core\Render\RendererInterface::render()
*/
function toolbar_prerender_toolbar_administration_tray(array $element) {
$menu_tree = \Drupal::service('toolbar.menu_tree');
......
......@@ -900,7 +900,7 @@ function user_delete_multiple(array $uids) {
* content language of the current request.
*
* @return array
* An array as expected by drupal_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);
......@@ -918,7 +918,8 @@ function user_view($account, $view_mode = 'full', $langcode = NULL) {
* content language of the current request.
*
* @return array
* An array in the format expected by drupal_render().
* An array in the format 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);
......
......@@ -326,9 +326,10 @@ function views_theme_suggestions_container_alter(array &$suggestions, array $var
*
* @param $render_element
* The renderable array to which contextual links will be added. This array
* should be suitable for passing in to drupal_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
......
......@@ -32,7 +32,7 @@ trait EntityViewTrait {
* (optional) Whether to clear the cache for this entity.
* @return array
*
* @see drupal_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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment