Automattic\WooCommerce\Internal\PushNotifications\Services

DriverAvailabilityService::resolve │ private │ WC 1.0

Reports a check's result as null when the check could not be performed.

The check methods return false on failure so that the gating callers, such as {@see self::is_remote_proxy_available()}, stay boolean and fail closed. The status response wants the distinction, so it is recovered here.

Method of the class: DriverAvailabilityService{}

No Hooks.

Returns

bool|null.

Usage

// private - for code of main (parent) class only
$result = $this->resolve( $result, $check_key ): ?bool;
$result(true|false) (required)
The value the check returned.
$check_key(string) (required)
The check to look up in {@see self::$failed_checks}.

DriverAvailabilityService::resolve() code WC 11.3.0

private function resolve( bool $result, string $check_key ): ?bool {
	return empty( $this->failed_checks[ $check_key ] ) ? $result : null;
}