HEX
Server: LiteSpeed
System: Linux s166.bitcommand.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: h340499 (1922)
PHP: 8.2.16
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/h340499/public_html/wp-content/plugins/wp-rocket/inc/Engine/Debug/Resolver.php
<?php

namespace WP_Rocket\Engine\Debug;

use WP_Rocket\Admin\Options_Data;

/**
 * Resolver.
 */
class Resolver {

	/**
	 * Array of WP Rocket Options.
	 *
	 * @var array
	 */
	private $options_services = [
		'remove_unused_css' => [
			'service' => 'rucss_debug_subscriber',
			'class'   => 'WP_Rocket\Engine\Debug\RUCSS\Subscriber',
		],
	];

	/**
	 * Debug options instance.
	 *
	 * @var Options_Data
	 */
	private $options;

	/**
	 * Instantiate the class.
	 *
	 * @param Options_Data $options Options instance.
	 */
	public function __construct( Options_Data $options ) {
		$this->options = $options;
	}

	/**
	 * Ships an array of available services.
	 *
	 * @return array Array of services.
	 */
	public function get_services(): array {
		$set_services = [];

		if ( empty( $this->options_services ) ) {
			return [];
		}

		foreach ( $this->options_services as $option => $services ) {
			if ( ! (bool) $this->options->get( $option, 0 ) ) {
				continue;
			}

			$set_services[] = $services;
		}

		return $set_services;
	}
}