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

Yoast / wordpress-seo / a8a215def53aa38d83991bd5baaddd3337e43c4b

07 Nov 2025 10:08AM UTC coverage: 49.286%. First build
a8a215def53aa38d83991bd5baaddd3337e43c4b

Pull #22691

github

web-flow
Merge aeebaf311 into b63825c5c
Pull Request #22691: Initialize the backend work needed for the tasklist.

7 of 184 new or added lines in 13 files covered. (3.8%)

17497 of 35501 relevant lines covered (49.29%)

3.89 hits per line

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

0.0
/src/task-list/application/tasks-collector.php
1
<?php
2

3
namespace Yoast\WP\SEO\Task_List\Application;
4

5
use Yoast\WP\SEO\Task_List\Domain\Completeable_Task_Interface;
6
use Yoast\WP\SEO\Task_List\Domain\Task_Interface;
7

8
/**
9
 * Manages the collection of tasks.
10
 */
11
class Tasks_Collector {
12

13
        /**
14
         * Holds all the tasks.
15
         *
16
         * @var Task_Interface[]
17
         */
18
        private $tasks;
19

20
        /**
21
         * Constructs the collector.
22
         *
23
         * @param Task_Interface ...$tasks All the tasks.
24
         */
NEW
25
        public function __construct( Task_Interface ...$tasks ) {
×
NEW
26
                $tasks_with_id = [];
×
NEW
27
                foreach ( $tasks as $task ) {
×
NEW
28
                        $tasks_with_id[ $task->get_id() ] = $task;
×
29
                }
30

NEW
31
                $this->tasks = $tasks_with_id;
×
32
        }
33

34
        /**
35
         * Gets a task.
36
         *
37
         * @param string $task_id The task ID.
38
         *
39
         * @return Task_Interface The given task.
40
         */
NEW
41
        public function get_task( string $task_id ): ?Task_Interface {
×
NEW
42
                return ( $this->tasks[ $task_id ] ?? null );
×
43
        }
44

45
        /**
46
         * Gets a completeable task.
47
         *
48
         * @param string $task_id The task ID.
49
         *
50
         * @return Task_Interface The given task.
51
         */
NEW
52
        public function get_completeable_task( string $task_id ): ?Completeable_Task_Interface {
×
NEW
53
                $task = ( $this->tasks[ $task_id ] ?? null );
×
54

NEW
55
                if ( ! $task instanceof Completeable_Task_Interface ) {
×
NEW
56
                        return null;
×
57
                }
58

NEW
59
                return $task;
×
60
        }
61

62
        /**
63
         * Gets the tasks.
64
         *
65
         * @return array<string, array<string, Task_Interface>> The tasks.
66
         */
NEW
67
        public function get_tasks() {
×
NEW
68
                return $this->tasks;
×
69
        }
70
}
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