function Deprecation::trigger
Trigger a deprecation for the given package and identfier.
The link should point to a Github issue or Wiki entry detailing the deprecation. It is additionally used to de-duplicate the trigger of the same deprecation during a request.
Parameters
float|int|string $args:
9 calls to Deprecation::trigger()
- Extends_::create in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Tags/ Extends_.php - Implements_::create in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Tags/ Implements_.php - ParamFactory::create in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Tags/ Factory/ ParamFactory.php - Template::create in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Tags/ Template.php - Token::offsetExists in vendor/
doctrine/ lexer/ src/ Token.php
File
-
vendor/
doctrine/ deprecations/ lib/ Doctrine/ Deprecations/ Deprecation.php, line 78
Class
- Deprecation
- Manages Deprecation logging in different ways.
Namespace
Doctrine\DeprecationsCode
public static function trigger(string $package, string $link, string $message, ...$args) : void {
$type = self::$type ?? self::getTypeFromEnv();
if ($type === self::TYPE_NONE) {
return;
}
if (isset(self::$ignoredLinks[$link])) {
return;
}
if (array_key_exists($link, self::$triggeredDeprecations)) {
self::$triggeredDeprecations[$link]++;
}
else {
self::$triggeredDeprecations[$link] = 1;
}
if (self::$deduplication === true && self::$triggeredDeprecations[$link] > 1) {
return;
}
if (isset(self::$ignoredPackages[$package])) {
return;
}
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
$message = sprintf($message, ...$args);
self::delegateTriggerToBackend($message, $backtrace, $link, $package);
}