HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/the-events-calendar/src/Tribe/Aggregator/Record/Void_Queue.php
<?php

/**
 * Class Tribe__Events__Aggregator__Record__Void_Queue
 *
 * @since 4.6.22
 */
class Tribe__Events__Aggregator__Record__Void_Queue
	implements Tribe__Events__Aggregator__Record__Queue_Interface {

	/**
	 * The error string for the queue.
	 *
	 * @var string
	 */
	protected $error;

	/**
	 * The WP_Error instance used to build the void queue, if any.
	 *
	 * @var WP_Error
	 */
	protected $wp_error;

	/**
	 * Tribe__Events__Aggregator__Record__Void_Queue constructor.
	 *
	 * @param string|WP_Error $error The reason, in form of a string or
	 *                               `WP_Error` object, why this queue
	 *                               is void.
	 */
	public function __construct( $error ) {
		if ( $error instanceof WP_Error ) {
			$this->error    = $error->get_error_message();
			$this->wp_error = $error;

			return;
		}

		$this->error = $error;
	}

	/**
	 * {@inheritdoc}
	 */
	public function activity() {
		return new Tribe__Events__Aggregator__Record__Activity();
	}

	/**
	 * {@inheritdoc}
	 */
	public function count() {
		return 0;
	}

	/**
	 * {@inheritdoc}
	 */
	public function is_empty() {
		// A void queue is not empty, it's void.
		return false;
	}

	/**
	 * {@inheritdoc}
	 */
	public function process( $batch_size = null ) {
		return $this;
	}

	/**
	 * {@inheritdoc}
	 */
	public function progress_percentage() {
		// return a 0% progress percentage to make sure the queue processor will process it.
		return 0;
	}

	/**
	 * {@inheritdoc}
	 */
	public function set_in_progress_flag() {
		// no-op
	}

	/**
	 * {@inheritdoc}
	 */
	public function clear_in_progress_flag() {
		// no-op
	}

	/**
	 * {@inheritdoc}
	 */
	public function is_in_progress() {
		// mark the queue as in progress to make the queue processor process it.
		return true;
	}

	/**
	 * {@inheritdoc}
	 */
	public function get_queue_type() {
		// not really important, still let's maintain coherence.
		return Tribe__Events__Main::POSTTYPE;
	}

	/**
	 * {@inheritdoc}
	 */
	public function is_stuck() {
		return true;
	}

	/**
	 * {@inheritdoc}
	 */
	public function kill_queue() {
		if ( empty( $this->error ) ) {
			$this->error = __( 'Unable to process this import - a breakage or conflict may have resulted in the import halting.', 'the-events-calendar' );
		}

		return true;
	}

	/**
	 * {@inheritdoc}
	 */
	public function has_errors() {
		return null !== $this->error;
	}

	/**
	 * {@inheritdoc}
	 */
	public function get_error_message() {
		return $this->error;
	}

	/**
	 * Returns the `WP_Error` instance used to build this void queue, if any.
	 *
	 * @since 4.6.22
	 *
	 * @return WP_Error|null The `WP_Error` used to build this void queue or `null`
	 *                       if no `WP_Error` object was used to build this void queue.
	 */
	public function get_wp_error() {
		return $this->wp_error;
	}
}