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.

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

Хуков нет.

Возвращает

bool|null.

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

// private - только в коде основоного (родительского) класса
$result = $this->resolve( $result, $check_key ): ?bool;
$result(true|false) (обязательный)
The value the check returned.
$check_key(строка) (обязательный)
The check to look up in {@see self::$failed_checks}.

Код DriverAvailabilityService::resolve() WC 11.2.2

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