Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Deprecation.php

function Deprecation::delegateTriggerToBackend

Parameters

list<array{function: string, line?: int, file?: string, class?: class-string, type?: string, args?: mixed[], object?: object}> $backtrace:

2 calls to Deprecation::delegateTriggerToBackend()
Deprecation::trigger in vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php
Trigger a deprecation for the given package and identfier.
Deprecation::triggerIfCalledFromOutside in vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php
Trigger a deprecation for the given package and identifier when called from outside.

File

vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php, line 179

Class

Deprecation
Manages Deprecation logging in different ways.

Namespace

Doctrine\Deprecations

Code

private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package) : void {
    $type = self::$type ?? self::getTypeFromEnv();
    if (($type & self::TYPE_PSR_LOGGER) > 0) {
        $context = [
            'file' => $backtrace[0]['file'] ?? null,
            'line' => $backtrace[0]['line'] ?? null,
            'package' => $package,
            'link' => $link,
        ];
        assert(self::$logger !== null);
        self::$logger->notice($message, $context);
    }
    if (!(($type & self::TYPE_TRIGGER_ERROR) > 0)) {
        return;
    }
    $message .= sprintf(' (%s:%d called by %s:%d, %s, package %s)', self::basename($backtrace[0]['file'] ?? 'native code'), $backtrace[0]['line'] ?? 0, self::basename($backtrace[1]['file'] ?? 'native code'), $backtrace[1]['line'] ?? 0, $link, $package);
    @trigger_error($message, E_USER_DEPRECATED);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal