Automattic\WooCommerce\Admin\RemoteInboxNotifications

RemoteInboxNotificationsEngine::run │ public static │ WC 1.0

Go through the specs and run them.

Method of the class: RemoteInboxNotificationsEngine{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = RemoteInboxNotificationsEngine::run();

RemoteInboxNotificationsEngine::run() code WC 11.3.0

public static function run() {
	$data_source_poller = RemoteInboxNotificationsDataSourcePoller::get_instance();
	$specs              = $data_source_poller->get_specs_from_data_sources();

	if ( false === $specs || ! is_countable( $specs ) ) {
		return;
	}

	$stored_state    = self::get_stored_state();
	$errors          = array();
	$processed_slugs = array();

	foreach ( $specs as $spec ) {
		$error = SpecRunner::run_spec( $spec, $stored_state );
		if ( isset( $error ) ) {
			$errors[] = $error;
		}
		if ( isset( $spec->slug ) && is_scalar( $spec->slug ) ) {
			$processed_slugs[] = (string) $spec->slug;
		}
	}

	self::hide_withdrawn_alerts( $processed_slugs, $data_source_poller->get_published_snapshot() );

	if ( count( $errors ) > 0 ) {
		self::log_errors( $errors );
	}
}