function DeprecationHandler::isIgnoredDeprecation

Determines if an actual deprecation should be ignored.

Deprecations that match the patterns included in the ignore file should be ignored.

Parameters

string $deprecationMessage: The actual deprecation message triggered via trigger_error().

1 call to DeprecationHandler::isIgnoredDeprecation()
BootstrapErrorHandler::__invoke in core/tests/Drupal/TestTools/ErrorHandler/BootstrapErrorHandler.php
Executes when the object is called as a function.

File

core/tests/Drupal/TestTools/Extension/DeprecationBridge/DeprecationHandler.php, line 211

Class

DeprecationHandler
Drupal's PHPUnit extension to manage code deprecation.

Namespace

Drupal\TestTools\Extension\DeprecationBridge

Code

public static function isIgnoredDeprecation(string $deprecationMessage) : bool {
    if (!self::$deprecationIgnorePatterns) {
        return FALSE;
    }
    $result = @preg_filter(self::$deprecationIgnorePatterns, '$0', $deprecationMessage);
    if (preg_last_error() !== \PREG_NO_ERROR) {
        throw new \RuntimeException(preg_last_error_msg());
    }
    return (bool) $result;
}

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