deprecation_test.module

Same filename in other branches
  1. 9 core/modules/system/tests/modules/deprecation_test/deprecation_test.module
  2. 8.9.x core/modules/system/tests/modules/deprecation_test/deprecation_test.module
  3. 10 core/modules/system/tests/modules/deprecation_test/deprecation_test.module

File

core/modules/system/tests/modules/deprecation_test/deprecation_test.module

View source
<?php


/**
 * @file
 * Contains functions for testing calling deprecated functions in tests.
 */
declare (strict_types=1);

/**
 * 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 deprecated_test_function().
 *
 * @see https://www.drupal.org/project/drupal/issues/2870194
 */
function deprecation_test_function() {
    // phpcs:ignore Drupal.Semantics.FunctionTriggerError
    @trigger_error('This is the deprecation message for deprecation_test_function().', E_USER_DEPRECATED);
    return 'known_return_value';
}

/**
 * Implements hook_deprecated_hook().
 */
function deprecation_test_deprecated_hook($arg) {
    return $arg;
}

/**
 * Implements hook_deprecated_alter_alter().
 */
function deprecation_test_deprecated_alter_alter(&$data, $context1, $context2) {
    $data = [
        $context1,
        $context2,
    ];
}

Functions

Title Deprecated Summary
deprecation_test_deprecated_alter_alter Implements hook_deprecated_alter_alter().
deprecation_test_deprecated_hook Implements hook_deprecated_hook().
deprecation_test_function

in drupal:8.4.0 and is removed from drupal:9.0.0. This is the deprecation message for deprecated_test_function().

A deprecated function.

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