WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\RemoteInboxNotifications

DataSourcePoller::validate_action() private WC 1.0

Validate the action.

{} It's a method of the class: DataSourcePoller{}

No Hooks.

Return

true|false. The result of the validation.

Usage

$result = DataSourcePoller::validate_action( $action, $url );
$action(object) (required)
The action to validate.
$url(string) (required)
The url of the feed containing the action (for error reporting).

Code of DataSourcePoller::validate_action() WC 5.3.0

<?php
private static function validate_action( $action, $url ) {
	$logger         = self::get_logger();
	$logger_context = array( 'source' => $url );

	if ( ! isset( $action->locales ) || ! is_array( $action->locales ) ) {
		$logger->error(
			'Action is invalid because it has empty or missing locales in feed',
			$logger_context
		);
		// phpcs:ignore
		$logger->error( print_r( $action, true ), $logger_context );

		return false;
	}

	if ( null === SpecRunner::get_action_locale( $action->locales ) ) {
		$logger->error(
			'Action is invalid because the locale could not be retrieved in feed',
			$logger_context
		);
		// phpcs:ignore
		$logger->error( print_r( $action, true ), $logger_context );

		return false;
	}

	if ( ! isset( $action->name ) ) {
		$logger->error(
			'Action is invalid because the name is missing in feed',
			$logger_context
		);
		// phpcs:ignore
		$logger->error( print_r( $action, true ), $logger_context );

		return false;
	}

	if ( ! isset( $action->status ) ) {
		$logger->error(
			'Action is invalid because the status is missing in feed',
			$logger_context
		);
		// phpcs:ignore
		$logger->error( print_r( $action, true ), $logger_context );

		return false;
	}

	return true;
}