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

Yoast / wordpress-seo / da4efbc5b07d9422360e8da09157e996aa6d4c8e

13 May 2026 09:45AM UTC coverage: 50.158%. First build
da4efbc5b07d9422360e8da09157e996aa6d4c8e

Pull #23265

github

web-flow
Merge c231415c9 into b17f347fb
Pull Request #23265: feat: authenticate yoast-ai requests with MyYoast OAuth tokens

129 of 246 new or added lines in 16 files covered. (52.44%)

20769 of 41407 relevant lines covered (50.16%)

4.0 hits per line

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

0.0
/src/ai/http-request/domain/response.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4

5
namespace Yoast\WP\SEO\AI\HTTP_Request\Domain;
6

7
/**
8
 * Class Response
9
 * Represents a response from the AI Generator API.
10
 */
11
class Response {
12

13
        /**
14
         * The response body.
15
         *
16
         * @var string
17
         */
18
        private $body;
19

20
        /**
21
         * The response code.
22
         *
23
         * @var int
24
         */
25
        private $response_code;
26

27
        /**
28
         * The response message.
29
         *
30
         * @var string
31
         */
32
        private $message;
33

34
        /**
35
         * The error code.
36
         *
37
         * @var string
38
         */
39
        private $error_code;
40

41
        /**
42
         * The missing licenses.
43
         *
44
         * @var array<string>
45
         */
46
        private $missing_licenses;
47

48
        /**
49
         * The response headers, keyed by lower-cased header name.
50
         *
51
         * @var array<string, string|array<string>>
52
         */
53
        private $headers;
54

55
        /**
56
         * Response constructor.
57
         *
58
         * @param string                              $body             The response body.
59
         * @param int                                 $response_code    The response code.
60
         * @param string                              $message          The response message.
61
         * @param string                              $error_code       The error code.
62
         * @param array<string>                       $missing_licenses The missing licenses.
63
         * @param array<string, string|array<string>> $headers          The response headers, keyed by lower-cased header name.
64
         */
NEW
65
        public function __construct( string $body, int $response_code, string $message, string $error_code = '', $missing_licenses = [], array $headers = [] ) {
×
66
                $this->body             = $body;
×
67
                $this->response_code    = $response_code;
×
68
                $this->message          = $message;
×
69
                $this->error_code       = $error_code;
×
70
                $this->missing_licenses = $missing_licenses;
×
NEW
71
                $this->headers          = $headers;
×
72
        }
73

74
        /**
75
         * Gets the response body.
76
         *
77
         * @return string The response body.
78
         */
79
        public function get_body() {
×
80
                return $this->body;
×
81
        }
82

83
        /**
84
         * Gets the response code.
85
         *
86
         * @return int The response code.
87
         */
88
        public function get_response_code(): int {
×
89
                return $this->response_code;
×
90
        }
91

92
        /**
93
         * Gets the response message.
94
         *
95
         * @return string The response message.
96
         */
97
        public function get_message(): string {
×
98
                return $this->message;
×
99
        }
100

101
        /**
102
         * Gets the error code.
103
         *
104
         * @return string The error code.
105
         */
106
        public function get_error_code(): string {
×
107
                return $this->error_code;
×
108
        }
109

110
        /**
111
         * Gets the missing licenses.
112
         *
113
         * @return array<string> The missing licenses.
114
         */
115
        public function get_missing_licenses(): array {
×
116
                return $this->missing_licenses;
×
117
        }
118

119
        /**
120
         * Gets the response headers, keyed by lower-cased header name.
121
         *
122
         * @return array<string, string|array<string>> The response headers.
123
         */
NEW
124
        public function get_headers(): array {
×
NEW
125
                return $this->headers;
×
126
        }
127
}
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