• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / a7886492b145fdf70261f7ca2cb0fbcb3562b15b

25 Nov 2024 01:47PM UTC coverage: 54.184% (-0.03%) from 54.215%
a7886492b145fdf70261f7ca2cb0fbcb3562b15b

Pull #21852

github

web-flow
Merge b930e736a into 16577a01e
Pull Request #21852: 339 dashboard use request to get the actual scores

7593 of 13670 branches covered (55.54%)

Branch coverage included in aggregate %.

0 of 77 new or added lines in 15 files covered. (0.0%)

989 existing lines in 3 files now uncovered.

29764 of 55275 relevant lines covered (53.85%)

41521.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/dashboard/application/configuration/dashboard-configuration.php
1
<?php
2

3

4
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
5
namespace Yoast\WP\SEO\Dashboard\Application\Configuration;
6

7
use Yoast\WP\SEO\Dashboard\Application\Content_Types\Content_Types_Repository;
8
use Yoast\WP\SEO\Dashboard\Application\Endpoints\Endpoints_Repository;
9
use Yoast\WP\SEO\Dashboard\Infrastructure\Nonces\Nonce_Repository;
10
use Yoast\WP\SEO\Editors\Application\Analysis_Features\Enabled_Analysis_Features_Repository;
11
use Yoast\WP\SEO\Editors\Framework\Keyphrase_Analysis;
12
use Yoast\WP\SEO\Editors\Framework\Readability_Analysis;
13
use Yoast\WP\SEO\Helpers\Indexable_Helper;
14
use Yoast\WP\SEO\Helpers\User_Helper;
15

16
/**
17
 * Responsible for the dashboard configuration.
18
 */
19
class Dashboard_Configuration {
20

21
        /**
22
         * The content types repository.
23
         *
24
         * @var Content_Types_Repository $content_types_repository
25
         */
26
        private $content_types_repository;
27

28
        /**
29
         * The indexable helper.
30
         *
31
         * @var Indexable_Helper $indexable_helper
32
         */
33
        private $indexable_helper;
34

35
        /**
36
         * The user helper.
37
         *
38
         * @var User_Helper $user_helper
39
         */
40
        private $user_helper;
41

42
        /**
43
         * The repository.
44
         *
45
         * @var Enabled_Analysis_Features_Repository
46
         */
47
        private $enabled_analysis_features_repository;
48

49
        /**
50
         * The endpoints repository.
51
         *
52
         * @var Endpoints_Repository
53
         */
54
        private $endpoints_repository;
55

56
        /**
57
         * The nonce repository.
58
         *
59
         * @var Nonce_Repository
60
         */
61
        private $nonce_repository;
62

63
        /**
64
         * The constructor.
65
         *
66
         * @param Content_Types_Repository             $content_types_repository             The content types repository.
67
         * @param Indexable_Helper                     $indexable_helper                     The indexable helper
68
         *                                                                                   repository.
69
         * @param User_Helper                          $user_helper                          The user helper.
70
         * @param Enabled_Analysis_Features_Repository $enabled_analysis_features_repository The analysis feature
71
         *                                                                                   repository.
72
         * @param Endpoints_Repository                 $endpoints_repository                 The endpoints repository.
73
         * @param Nonce_Repository                     $nonce_repository                     The nonce repository.
74
         */
75
        public function __construct(
×
76
                Content_Types_Repository $content_types_repository,
77
                Indexable_Helper $indexable_helper,
78
                User_Helper $user_helper,
79
                Enabled_Analysis_Features_Repository $enabled_analysis_features_repository,
80
                Endpoints_Repository $endpoints_repository,
81
                Nonce_Repository $nonce_repository
82
        ) {
83
                $this->content_types_repository             = $content_types_repository;
×
84
                $this->indexable_helper                     = $indexable_helper;
×
85
                $this->user_helper                          = $user_helper;
×
86
                $this->enabled_analysis_features_repository = $enabled_analysis_features_repository;
×
NEW
87
                $this->endpoints_repository                 = $endpoints_repository;
×
NEW
88
                $this->nonce_repository                     = $nonce_repository;
×
89
        }
90

91
        /**
92
         * Returns a configuration
93
         *
94
         * @return array<string,array<string>>
95
         */
96
        public function get_configuration(): array {
×
97
                return [
98
                        'contentTypes'            => $this->content_types_repository->get_content_types(),
×
99
                        'indexablesEnabled'       => $this->indexable_helper->should_index_indexables(),
×
100
                        'displayName'             => $this->user_helper->get_current_user_display_name(),
×
101
                        'enabledAnalysisFeatures' => $this->enabled_analysis_features_repository->get_features_by_keys(
×
102
                                [
103
                                        Readability_Analysis::NAME,
×
104
                                        Keyphrase_Analysis::NAME,
105
                                ]
106
                        )->to_array(),
×
NEW
107
                        'endpoints'               => $this->endpoints_repository->get_all_endpoints()->to_array(),
×
NEW
108
                        'nonce'                   => $this->nonce_repository->get_rest_nonce(),
×
109
                ];
110
        }
111
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc