Automattic\WooCommerce\Vendor\GraphQL\Error
Warning::enable
Re-enable previously suppressed 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::enable( $enable ): void;
- $enable(true|false|int)
- .
Default:true
Warning::enable() Warning::enable code WC 11.0.1
public static function enable($enable = true): void
{
if ($enable === true) {
self::$enableWarnings = self::ALL;
} elseif ($enable === false) {
self::$enableWarnings = 0;
// @phpstan-ignore-next-line necessary until we can use proper unions
} elseif (is_int($enable)) {
self::$enableWarnings |= $enable;
} else {
$type = gettype($enable);
throw new \InvalidArgumentException("Expected type bool|int, got {$type}.");
}
}