Automattic\WooCommerce\Vendor\GraphQL\Error

Warning::suppresspublic staticWC 1.0

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

Method of the class: Warning{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Warning::suppress( $suppress ): void;
$suppress(true|false|int)
.
Default: true

Warning::suppress() code WC 10.9.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}.");
    }
}