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

Yoast / wordpress-seo / d645700e4dfb868544c3892f819f7cb13858bc39

16 Dec 2025 07:12AM UTC coverage: 41.557%. First build
d645700e4dfb868544c3892f819f7cb13858bc39

Pull #22815

github

web-flow
Merge 5fab7907e into 69bfc7a0e
Pull Request #22815: Add tracking for the task list.

2608 of 9617 branches covered (27.12%)

Branch coverage included in aggregate %.

4 of 80 new or added lines in 11 files covered. (5.0%)

22739 of 51376 relevant lines covered (44.26%)

4.72 hits per line

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

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

5
use Yoast\WP\SEO\Task_List\Domain\Components\Call_To_Action_Entry;
6

7
/**
8
 * Abstract class for a task.
9
 */
10
abstract class Abstract_Task implements Task_Interface {
11

12
        /**
13
         * The ID of the task.
14
         *
15
         * @var string
16
         */
17
        protected $id;
18

19
        /**
20
         * The priority of the task.
21
         *
22
         * @var string
23
         */
24
        protected $priority;
25

26
        /**
27
         * The duration of the task.
28
         *
29
         * @var int
30
         */
31
        protected $duration;
32

33
        /**
34
         * The enhanced call to action.
35
         *
36
         * @var Call_To_Action_Entry
37
         */
38
        protected $enhanced_call_to_action;
39

40
        /**
41
         * Returns the task ID.
42
         *
43
         * @return string
44
         */
45
        public function get_id(): string {
×
46
                return $this->id;
×
47
        }
48

49
        /**
50
         * Returns the task's priority.
51
         *
52
         * @return string
53
         */
54
        public function get_priority(): string {
×
55
                return $this->priority;
×
56
        }
57

58
        /**
59
         * Returns the task's duration.
60
         *
61
         * @return int
62
         */
63
        public function get_duration(): int {
×
64
                return $this->duration;
×
65
        }
66

67
        /**
68
         * Returns the task's badge.
69
         *
70
         * @return string|null
71
         */
72
        public function get_badge(): ?string {
×
73
                return null;
×
74
        }
75

76
        /**
77
         * Sets the enhanced call to action.
78
         *
79
         * @param Call_To_Action_Entry $enhanced_call_to_action The enhanced call to action.
80
         *
81
         * @return void
82
         */
NEW
83
        public function set_enhanced_call_to_action( ?Call_To_Action_Entry $enhanced_call_to_action ): void {
×
NEW
84
                $this->enhanced_call_to_action = $enhanced_call_to_action;
×
85
        }
86

87
        /**
88
         * Returns the enhanced call to action.
89
         *
90
         * @return Call_To_Action_Entry|null
91
         */
NEW
92
        public function get_enhanced_call_to_action(): ?Call_To_Action_Entry {
×
NEW
93
                return $this->enhanced_call_to_action;
×
94
        }
95

96
        /**
97
         * Returns an array representation of the task data.
98
         *
99
         * @return array<string, string|bool> Returns in an array format.
100
         */
101
        public function to_array(): array {
×
102
                $data = [
×
103
                        'id'           => $this->get_id(),
×
104
                        'duration'     => $this->get_duration(),
×
105
                        'priority'     => $this->get_priority(),
×
106
                        'badge'        => $this->get_badge(),
×
107
                        'isCompleted'  => $this->get_is_completed(),
×
NEW
108
                        'callToAction' => $this->get_enhanced_call_to_action()->to_array(),
×
109
                ];
×
110

111
                return \array_merge( $data, $this->get_copy_set()->to_array() );
×
112
        }
113
}
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