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

Breadcrumb

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

function DeprecatedCallableInfo::triggerDeprecation

File

vendor/twig/twig/src/DeprecatedCallableInfo.php, line 41

Class

DeprecatedCallableInfo
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig

Code

public function triggerDeprecation(?string $file = null, ?int $line = null) : void {
    $message = \sprintf('Twig %s "%s" is deprecated', ucfirst($this->type), $this->name);
    if ($this->altName) {
        $message .= \sprintf('; use "%s"', $this->altName);
        if ($this->altPackage) {
            $message .= \sprintf(' from the "%s" package', $this->altPackage);
        }
        if ($this->altVersion) {
            $message .= \sprintf(' (available since version %s)', $this->altVersion);
        }
        $message .= ' instead';
    }
    if ($file) {
        $message .= \sprintf(' in %s', $file);
        if ($line) {
            $message .= \sprintf(' at line %d', $line);
        }
    }
    $message .= '.';
    trigger_deprecation($this->package, $this->version, $message);
}
RSS feed
Powered by Drupal