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

Yoast / wordpress-seo / 947a0514c8ae6e99811eb0fc52c9b5725363aedd

07 Oct 2025 12:20PM UTC coverage: 49.452%. First build
947a0514c8ae6e99811eb0fc52c9b5725363aedd

Pull #22615

github

pls78
Fix conditional exclusion
Pull Request #22615: Feature/re organize ai code

671 of 732 new or added lines in 41 files covered. (91.67%)

17323 of 35030 relevant lines covered (49.45%)

3.9 hits per line

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

0.0
/src/routes/endpoint/endpoint-list.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
4
namespace Yoast\WP\SEO\Routes\Endpoint;
5

6
/**
7
 * List of endpoints.
8
 */
9
class Endpoint_List {
10

11
        /**
12
         * Holds the endpoints.
13
         *
14
         * @var array<Endpoint_Interface>
15
         */
16
        private $endpoints = [];
17

18
        /**
19
         * Adds an endpoint to the list.
20
         *
21
         * @param Endpoint_Interface $endpoint An endpoint.
22
         *
23
         * @return void
24
         */
25
        public function add_endpoint( Endpoint_Interface $endpoint ): void {
×
26
                $this->endpoints[] = $endpoint;
×
27
        }
28

29
        /**
30
         * Converts the list to an array.
31
         *
32
         * @return array<string, string> The array of endpoints.
33
         */
34
        public function to_array(): array {
×
35
                $result = [];
×
36
                foreach ( $this->endpoints as $endpoint ) {
×
37
                        $result[ $endpoint->get_name() ] = $endpoint->get_url();
×
38
                }
39

40
                return $result;
×
41
        }
42

43
        /**
44
         * Merges two Endpoint_List objects together.
45
         * Returns the current instance for method chaining.
46
         *
47
         * @param Endpoint_List $other_list The other Endpoint_List to merge with.
48
         *
49
         * @return $this
50
         */
NEW
51
        public function merge_with( Endpoint_List $other_list ): Endpoint_List {
×
NEW
52
                foreach ( $other_list->endpoints as $endpoint ) {
×
NEW
53
                        $this->add_endpoint( $endpoint );
×
54
                }
55

NEW
56
                return $this;
×
57
        }
58
}
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