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/delta/wp-content/plugins/wordpress-seo/src/dashboard/domain/score-results/score-result.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Dashboard\Domain\Score_Results;

/**
 * This class describes a score result.
 */
class Score_Result {

	/**
	 * The list of the current scores of the score result.
	 *
	 * @var Current_Scores_List
	 */
	private $current_scores_list;

	/**
	 * The time the query took to get the score results.
	 *
	 * @var float
	 */
	private $query_time;

	/**
	 * Whether cache was used to get the score results.
	 *
	 * @var bool
	 */
	private $is_cached_used;

	/**
	 * The constructor.
	 *
	 * @param Current_Scores_List $current_scores_list The list of the current scores of the score result.
	 * @param float               $query_time          The time the query took to get the score results.
	 * @param bool                $is_cached_used      Whether cache was used to get the score results.
	 */
	public function __construct( Current_Scores_List $current_scores_list, float $query_time, bool $is_cached_used ) {
		$this->current_scores_list = $current_scores_list;
		$this->query_time          = $query_time;
		$this->is_cached_used      = $is_cached_used;
	}

	/**
	 * Return this object represented by a key value array.
	 *
	 * @return array<string, array<array<string, string|int|array<string, string>>>|float|bool> Returns the name and if the feature is enabled.
	 */
	public function to_array(): array {
		return [
			'scores'    => $this->current_scores_list->to_array(),
			'queryTime' => $this->query_time,
			'cacheUsed' => $this->is_cached_used,
		];
	}
}