• 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-http-request/domain/response.php
1
<?php
2

3
namespace Yoast\WP\SEO\AI_HTTP_Request\Domain;
4

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

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

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

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

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

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

46
        /**
47
         * Response constructor.
48
         *
49
         * @param string        $body             The response body.
50
         * @param int           $response_code    The response code.
51
         * @param string        $message          The response message.
52
         * @param string        $error_code       The error code.
53
         * @param array<string> $missing_licenses The missing licenses.
54
         */
NEW
55
        public function __construct( string $body, int $response_code, string $message, string $error_code = '', $missing_licenses = [] ) {
×
NEW
56
                $this->body             = $body;
×
57
                $this->response_code    = $response_code;
×
58
                $this->message          = $message;
×
59
                $this->error_code       = $error_code;
×
60
                $this->missing_licenses = $missing_licenses;
×
61
        }
62

63
        /**
64
         * Gets the response body.
65
         *
66
         * @return string The response body.
67
         */
NEW
68
        public function get_body() {
×
NEW
69
                return $this->body;
×
70
        }
71

72
        /**
73
         * Gets the response code.
74
         *
75
         * @return int The response code.
76
         */
77
        public function get_response_code(): int {
×
78
                return $this->response_code;
×
79
        }
80

81
        /**
82
         * Gets the response message.
83
         *
84
         * @return string The response message.
85
         */
86
        public function get_message(): string {
×
87
                return $this->message;
×
88
        }
89

90
        /**
91
         * Gets the error code.
92
         *
93
         * @return string The error code.
94
         */
95
        public function get_error_code(): string {
×
96
                return $this->error_code;
×
97
        }
98

99
        /**
100
         * Gets the missing licenses.
101
         *
102
         * @return array<string> The missing licenses.
103
         */
104
        public function get_missing_licenses(): array {
×
105
                return $this->missing_licenses;
×
106
        }
107
}
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