Yoast\WP\SEO\Task_List\Application\Configuration

Task_List_Configuration{}Yoast 1.0

Responsible for the task list configuration.

Хуков нет.

Использование

$Task_List_Configuration = new Task_List_Configuration();
// use class methods

Методы

  1. public __construct(
  2. public get_configuration()

Код Task_List_Configuration{} Yoast 27.7

class Task_List_Configuration {

	/**
	 * The options helper.
	 *
	 * @var Options_Helper
	 */
	private $options_helper;

	/**
	 * The endpoints repository.
	 *
	 * @var Endpoints_Repository
	 */
	private $endpoints_repository;

	/**
	 * The constructor.
	 *
	 * @param Options_Helper       $options_helper       The options helper.
	 * @param Endpoints_Repository $endpoints_repository The endpoints repository.
	 */
	public function __construct(
		Options_Helper $options_helper,
		Endpoints_Repository $endpoints_repository
	) {
		$this->options_helper       = $options_helper;
		$this->endpoints_repository = $endpoints_repository;
	}

	/**
	 * Returns a configuration
	 *
	 * @return array<string, array<string>|array<string, string|array<string, array<string, int>>>>
	 */
	public function get_configuration(): array {
		$configuration = [
			'enabled'   => $this->options_helper->get( 'enable_task_list', true ),
			'endpoints' => $this->endpoints_repository->get_all_endpoints()->to_array(),
		];

		return $configuration;
	}
}