Automattic\WooCommerce\Vendor\GraphQL\Error

Warning::suppresspublic staticWC 1.0

Suppress warning by id (has no effect when custom warning handler is set).

Метод класса: Warning{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Warning::suppress( $suppress ): void;
$suppress(true|false|int)
.
По умолчанию: true

Код Warning::suppress() WC 11.0.1

public static function suppress($suppress = true): void
{
    if ($suppress === true) {
        self::$enableWarnings = 0;
    } elseif ($suppress === false) {
        self::$enableWarnings = self::ALL;
    // @phpstan-ignore-next-line necessary until we can use proper unions
    } elseif (is_int($suppress)) {
        self::$enableWarnings &= ~$suppress;
    } else {
        $type = gettype($suppress);
        throw new \InvalidArgumentException("Expected type bool|int, got {$type}.");
    }
}