DeprecatedController.php
Same filename and directory in other branches
- 11.x core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php
- 10 core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php
- 9 core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php
- 8.9.x core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php
Namespace
Drupal\deprecation_testFile
-
core/
modules/ system/ tests/ modules/ deprecation_test/ src/ DeprecatedController.php
View source
<?php
declare (strict_types=1);
namespace Drupal\deprecation_test;
/**
* Defines a controller that calls a deprecated method.
*/
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';
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| DeprecatedController | Defines a controller that calls a deprecated method. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.