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

Yoast / wordpress-seo / 5730cb79f488a5fed855d114b14f03b5a8cbf443

14 Jan 2025 01:34PM UTC coverage: 51.158%. First build
5730cb79f488a5fed855d114b14f03b5a8cbf443

Pull #21965

github

web-flow
Merge 8afb9bb5d into 9c6695675
Pull Request #21965: First run at a setup

0 of 103 new or added lines in 8 files covered. (0.0%)

16657 of 32560 relevant lines covered (51.16%)

3.96 hits per line

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

0.0
/src/dashboard/domain/search-rankings/search-data.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\Dashboard\Domain\Search_Rankings;
4

5
/**
6
 * Domain object that represents a single Search Data record.
7
 */
8
class Search_Data {
9

10
        /**
11
         * The amount of clicks a `key` gets.
12
         *
13
         * @var int $clicks
14
         */
15
        private $clicks;
16

17
        /**
18
         * The click-through rate a `key` gets.
19
         *
20
         * @var float $clicks
21
         */
22
        private $ctr;
23

24
        /**
25
         * The amount of impressions a `key` gets.
26
         *
27
         * @var int $impressions
28
         */
29
        private $impressions;
30

31
        /**
32
         * The average position for the given `key`.
33
         *
34
         * @var float $position
35
         */
36
        private $position;
37

38
        /**
39
         * An array representation of the different `keys`.
40
         * In the context of this domain object keys can represent a `URI` or a `search term`
41
         *
42
         * @var string[]
43
         */
44
        private $keys = [];
45

46
        /**
47
         * The seo score.
48
         *
49
         * @var int
50
         */
51
        private $seo_score;
52

53
        /**
54
         * The constructor.
55
         *
56
         * @param int      $clicks      The clicks.
57
         * @param float    $ctr         The ctr.
58
         * @param int      $impressions The impressions.
59
         * @param float    $position    The position.
60
         * @param string[] $keys        The clicks.
61
         */
NEW
62
        public function __construct( int $clicks, float $ctr, int $impressions, float $position, array $keys ) {
×
NEW
63
                $this->clicks      = $clicks;
×
NEW
64
                $this->ctr         = $ctr;
×
NEW
65
                $this->impressions = $impressions;
×
NEW
66
                $this->position    = $position;
×
NEW
67
                $this->keys        = $keys;
×
NEW
68
                $this->seo_score   = 0;
×
69
        }
70

71
        /**
72
         * The array representation of this domain object.
73
         *
74
         * @return array<string|float|int|string[]>
75
         */
NEW
76
        public function to_array(): array {
×
NEW
77
                return [
×
NEW
78
                        'clicks'      => $this->clicks,
×
NEW
79
                        'ctr'         => $this->ctr,
×
NEW
80
                        'impressions' => $this->impressions,
×
NEW
81
                        'position'    => $this->position,
×
NEW
82
                        'keys'        => $this->keys,
×
NEW
83
                        'seoScore'    => $this->seo_score,
×
NEW
84
                ];
×
85
        }
86
}
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