class DeprecatedController

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php \Drupal\deprecation_test\DeprecatedController
  2. 10 core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php \Drupal\deprecation_test\DeprecatedController
  3. 9 core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php \Drupal\deprecation_test\DeprecatedController
  4. 8.9.x core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php \Drupal\deprecation_test\DeprecatedController

Defines a controller that calls a deprecated method.

Hierarchy

Expanded class hierarchy of DeprecatedController

File

core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php, line 10

Namespace

Drupal\deprecation_test
View source
class DeprecatedController {
  
  /**
   * Controller callback.
   *
   * @return array
   *   Render array.
   */
  public function deprecatedMethod() {
    return [
      '#markup' => static::testDeprecation(),
    ];
  }
  
  /**
   * A deprecated function.
   *
   * @return string
   *   A known return value of 'known_return_value'.
   *
   * @deprecated in drupal:8.4.0 and is removed from drupal:9.0.0. This is
   *   the deprecation message for testDeprecation().
   *
   * @see https://www.drupal.org/project/drupal/issues/2870194
   */
  public static function testDeprecation() {
    // phpcs:ignore Drupal.Semantics.FunctionTriggerError
    @trigger_error('This is the deprecation message for testDeprecation().', E_USER_DEPRECATED);
    return 'known_return_value';
  }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary
DeprecatedController::deprecatedMethod public function Controller callback.
DeprecatedController::testDeprecation Deprecated public static function A deprecated function.

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