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

Yoast / wordpress-seo / 02161c3512e591358d6dbf3cf67787bec3053191

22 Jan 2026 01:17PM UTC coverage: 41.951%. First build
02161c3512e591358d6dbf3cf67787bec3053191

Pull #22891

github

web-flow
Merge 595294d91 into d721a7aa0
Pull Request #22891: Create the endpoints needed for the Improve your content's SEO task

2676 of 9801 branches covered (27.3%)

Branch coverage included in aggregate %.

17 of 202 new or added lines in 17 files covered. (8.42%)

23216 of 51919 relevant lines covered (44.72%)

4.75 hits per line

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

0.0
/src/task-list/domain/components/numeric-task-indicator.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\Task_List\Domain\Components;
4

5
/**
6
 * Numeric task indicator.
7
 * Used for displaying a numeric value (e.g., link count, word count).
8
 * Possibly to be used in a task that eg. counts incoming links.
9
 */
10
class Numeric_Task_Indicator implements Task_Indicator_Interface {
11

12
        /**
13
         * The numeric value.
14
         *
15
         * @var int
16
         */
17
        private $value;
18

19
        /**
20
         * The label describing what the number represents.
21
         *
22
         * @var string
23
         */
24
        private $label;
25

26
        /**
27
         * Optional suffix for the value (e.g., 'links', 'words').
28
         *
29
         * @var string|null
30
         */
31
        private $suffix;
32

33
        /**
34
         * Constructs the numeric indicator.
35
         *
36
         * @param int         $value  The numeric value.
37
         * @param string      $label  The label describing the value.
38
         * @param string|null $suffix Optional suffix for display.
39
         */
NEW
40
        public function __construct( int $value, string $label, ?string $suffix = null ) {
×
NEW
41
                $this->value  = $value;
×
NEW
42
                $this->label  = $label;
×
NEW
43
                $this->suffix = $suffix;
×
44
        }
45

46
        /**
47
         * Returns the type of the indicator.
48
         *
49
         * @return string
50
         */
NEW
51
        public function get_type(): string {
×
NEW
52
                return 'numeric';
×
53
        }
54

55
        /**
56
         * Returns the numeric value.
57
         *
58
         * @return int
59
         */
NEW
60
        public function get_value(): int {
×
NEW
61
                return $this->value;
×
62
        }
63

64
        /**
65
         * Returns the label.
66
         *
67
         * @return string
68
         */
NEW
69
        public function get_label(): string {
×
NEW
70
                return $this->label;
×
71
        }
72

73
        /**
74
         * Returns the suffix.
75
         *
76
         * @return string|null
77
         */
NEW
78
        public function get_suffix(): ?string {
×
NEW
79
                return $this->suffix;
×
80
        }
81

82
        /**
83
         * Returns the indicator as an array for JSON serialization.
84
         *
85
         * @return array<string, int|string|null>
86
         */
NEW
87
        public function to_array(): array {
×
NEW
88
                return [
×
NEW
89
                        'type'   => $this->get_type(),
×
NEW
90
                        'value'  => $this->value,
×
NEW
91
                        'label'  => $this->label,
×
NEW
92
                        'suffix' => $this->suffix,
×
NEW
93
                ];
×
94
        }
95
}
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

© 2026 Coveralls, Inc