PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / task-list / application / configuration / task-list-configuration.php

task-list-configuration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.5, at src/task-list/application/configuration/task-list-configuration.php

56 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
4 namespace Yoast\WP\SEO\Task_List\Application\Configuration;
5
6 use Yoast\WP\SEO\Helpers\Options_Helper;
7 use Yoast\WP\SEO\Task_List\Application\Endpoints\Endpoints_Repository;
8
9 /**
10 * Responsible for the task list configuration.
11 */
12 class Task_List_Configuration {
13
14 /**
15 * The options helper.
16 *
17 * @var Options_Helper
18 */
19 private $options_helper;
20
21 /**
22 * The endpoints repository.
23 *
24 * @var Endpoints_Repository
25 */
26 private $endpoints_repository;
27
28 /**
29 * The constructor.
30 *
31 * @param Options_Helper $options_helper The options helper.
32 * @param Endpoints_Repository $endpoints_repository The endpoints repository.
33 */
34 public function __construct(
35 Options_Helper $options_helper,
36 Endpoints_Repository $endpoints_repository
37 ) {
38 $this->options_helper = $options_helper;
39 $this->endpoints_repository = $endpoints_repository;
40 }
41
42 /**
43 * Returns a configuration
44 *
45 * @return array<string, array<string>|array<string, string|array<string, array<string, int>>>>
46 */
47 public function get_configuration(): array {
48 $configuration = [
49 'enabled' => $this->options_helper->get( 'enable_task_list', true ),
50 'endpoints' => $this->endpoints_repository->get_all_endpoints()->to_array(),
51 ];
52
53 return $configuration;
54 }
55 }
56