• 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/ai/http-request/domain/response.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\AI\HTTP_Request\Domain;
5

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

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

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

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

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

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

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

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

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

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

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

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