You are here

FunctionTriggerErrorUnitTest.3.inc in Coder 8.3

Same filename and directory in other branches
  1. 8.3.x tests/Drupal/Semantics/FunctionTriggerErrorUnitTest.3.inc

Example code for strict deprecated FunctionTriggerError sniff test.

File

tests/Drupal/Semantics/FunctionTriggerErrorUnitTest.3.inc
View source
<?php

namespace MyNamespace\triggerErrorTest;


/**
 * @file
 * Example code for strict deprecated FunctionTriggerError sniff test.
 */

// This conforms the strict version of the trigger_error deprecation standard.
@trigger_error('Class \\foo is deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. Use \\bar instead. See https://www.drupal.org/node/123', E_USER_DEPRECATED);

// This fails the strict version of the trigger_error deprecation standard.
@trigger_error('Class \\foo is deprecated in drupal:8.5.0 but instead use \\bar in drupal:9.0.0. See https://www.drupal.org/node/123', E_USER_DEPRECATED);

/**
 * Test function one.
 *
 * @deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
 *   Use class bar instead.
 * @see https://www.drupal.org/node/123
 */
class foo {

}

Classes

Namesort descending Description
foo Deprecated Test function one.