function TestLocalTaskController::methodWithoutUpcastNode

Same name in other branches
  1. 9 core/modules/content_moderation/tests/modules/content_moderation_test_local_task/src/Controller/TestLocalTaskController.php \Drupal\content_moderation_test_local_task\Controller\TestLocalTaskController::methodWithoutUpcastNode()
  2. 8.9.x core/modules/content_moderation/tests/modules/content_moderation_test_local_task/src/Controller/TestLocalTaskController.php \Drupal\content_moderation_test_local_task\Controller\TestLocalTaskController::methodWithoutUpcastNode()
  3. 10 core/modules/content_moderation/tests/modules/content_moderation_test_local_task/src/Controller/TestLocalTaskController.php \Drupal\content_moderation_test_local_task\Controller\TestLocalTaskController::methodWithoutUpcastNode()

A method which does not hint the node parameter to avoid upcasting.

1 string reference to 'TestLocalTaskController::methodWithoutUpcastNode'
content_moderation_test_local_task.routing.yml in core/modules/content_moderation/tests/modules/content_moderation_test_local_task/content_moderation_test_local_task.routing.yml
core/modules/content_moderation/tests/modules/content_moderation_test_local_task/content_moderation_test_local_task.routing.yml

File

core/modules/content_moderation/tests/modules/content_moderation_test_local_task/src/Controller/TestLocalTaskController.php, line 15

Class

TestLocalTaskController
A test controller.

Namespace

Drupal\content_moderation_test_local_task\Controller

Code

public function methodWithoutUpcastNode($node) {
    return [
        '#markup' => 'It works!',
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.