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

Yoast / wordpress-seo / e57e01309ec9fc3afc714e6ce0fd243e7b6d1f90

27 May 2025 12:40PM UTC coverage: 45.733%. First build
e57e01309ec9fc3afc714e6ce0fd243e7b6d1f90

Pull #22275

github

web-flow
Merge f0a8d33c9 into 5f64dc203
Pull Request #22275: Move and refactor ai generator rest endpoints

0 of 392 new or added lines in 26 files covered. (0.0%)

15548 of 33997 relevant lines covered (45.73%)

3.64 hits per line

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

0.0
/src/ai-generator/domain/endpoint/endpoint-list.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\AI_Generator\Domain\Endpoint;
4

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

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

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

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

NEW
39
                return $result;
×
40
        }
41
}
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