Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
lib-innerbrowser/src/Codeception/Util/HttpCode.php at master · Codeception/lib-innerbrowser · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Codeception
lib-innerbrowser
Repository navigation
Code
Issues
12
(12)
Pull requests
7
(7)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
lib-innerbrowser
/
src
/
Codeception
/
Util
/
HttpCode.php
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
357 lines (353 loc) · 8.38 KB
master
Breadcrumbs
lib-innerbrowser
/
src
/
Codeception
/
Util
/
HttpCode.php
Copy path
Top
File metadata and controls
Code
Blame
357 lines (353 loc) · 8.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<?php
declare
(strict_types=
1
);
namespace
Codeception
\
Util
;
/**
* Class containing constants of HTTP Status Codes
* and method to print HTTP code with its description.
*
* Usage:
*
* ```php
* <?php
* use Codeception\Util\HttpCode;
*
* // using REST, PhpBrowser, or any Framework module
* $I->seeResponseCodeIs(HttpCode::OK);
* $I->dontSeeResponseCodeIs(HttpCode::NOT_FOUND);
* ```
*/
class
HttpCode
{
// const CONTINUE = 100;
/**
* @var int
*/
public
const
SWITCHING_PROTOCOLS
=
101
;
/**
* @var int
*/
public
const
PROCESSING
=
102
;
// RFC2518
/**
* @var int
*/
public
const
EARLY_HINTS
=
103
;
// RFC8297
/**
* @var int
*/
public
const
OK
=
200
;
/**
* @var int
*/
public
const
CREATED
=
201
;
/**
* @var int
*/
public
const
ACCEPTED
=
202
;
/**
* @var int
*/
public
const
NON_AUTHORITATIVE_INFORMATION
=
203
;
/**
* @var int
*/
public
const
NO_CONTENT
=
204
;
/**
* @var int
*/
public
const
RESET_CONTENT
=
205
;
/**
* @var int
*/
public
const
PARTIAL_CONTENT
=
206
;
/**
* @var int
*/
public
const
MULTI_STATUS
=
207
;
// RFC4918
/**
* @var int
*/
public
const
ALREADY_REPORTED
=
208
;
// RFC5842
/**
* @var int
*/
public
const
IM_USED
=
226
;
// RFC3229
/**
* @var int
*/
public
const
MULTIPLE_CHOICES
=
300
;
/**
* @var int
*/
public
const
MOVED_PERMANENTLY
=
301
;
/**
* @var int
*/
public
const
FOUND
=
302
;
/**
* @var int
*/
public
const
SEE_OTHER
=
303
;
/**
* @var int
*/
public
const
NOT_MODIFIED
=
304
;
/**
* @var int
*/
public
const
USE_PROXY
=
305
;
/**
* @var int
*/
public
const
RESERVED
=
306
;
/**
* @var int
*/
public
const
TEMPORARY_REDIRECT
=
307
;
/**
* @var int
*/
public
const
PERMANENTLY_REDIRECT
=
308
;
// RFC7238
/**
* @var int
*/
public
const
BAD_REQUEST
=
400
;
/**
* @var int
*/
public
const
UNAUTHORIZED
=
401
;
/**
* @var int
*/
public
const
PAYMENT_REQUIRED
=
402
;
/**
* @var int
*/
public
const
FORBIDDEN
=
403
;
/**
* @var int
*/
public
const
NOT_FOUND
=
404
;
/**
* @var int
*/
public
const
METHOD_NOT_ALLOWED
=
405
;
/**
* @var int
*/
public
const
NOT_ACCEPTABLE
=
406
;
/**
* @var int
*/
public
const
PROXY_AUTHENTICATION_REQUIRED
=
407
;
/**
* @var int
*/
public
const
REQUEST_TIMEOUT
=
408
;
/**
* @var int
*/
public
const
CONFLICT
=
409
;
/**
* @var int
*/
public
const
GONE
=
410
;
/**
* @var int
*/
public
const
LENGTH_REQUIRED
=
411
;
/**
* @var int
*/
public
const
PRECONDITION_FAILED
=
412
;
/**
* @var int
*/
public
const
REQUEST_ENTITY_TOO_LARGE
=
413
;
/**
* @var int
*/
public
const
REQUEST_URI_TOO_LONG
=
414
;
/**
* @var int
*/
public
const
UNSUPPORTED_MEDIA_TYPE
=
415
;
/**
* @var int
*/
public
const
REQUESTED_RANGE_NOT_SATISFIABLE
=
416
;
/**
* @var int
*/
public
const
EXPECTATION_FAILED
=
417
;
/**
* @var int
*/
public
const
I_AM_A_TEAPOT
=
418
;
// RFC2324
/**
* @var int
*/
public
const
MISDIRECTED_REQUEST
=
421
;
// RFC7540
/**
* @var int
*/
public
const
UNPROCESSABLE_ENTITY
=
422
;
// RFC4918
/**
* @var int
*/
public
const
LOCKED
=
423
;
// RFC4918
/**
* @var int
*/
public
const
FAILED_DEPENDENCY
=
424
;
// RFC4918
/**
* @var int
*/
public
const
RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL
=
425
;
// RFC2817
/**
* @var int
*/
public
const
UPGRADE_REQUIRED
=
426
;
// RFC2817
/**
* @var int
*/
public
const
PRECONDITION_REQUIRED
=
428
;
// RFC6585
/**
* @var int
*/
public
const
TOO_MANY_REQUESTS
=
429
;
// RFC6585
/**
* @var int
*/
public
const
REQUEST_HEADER_FIELDS_TOO_LARGE
=
431
;
// RFC6585
/**
* @var int
*/
public
const
UNAVAILABLE_FOR_LEGAL_REASONS
=
451
;
/**
* @var int
*/
public
const
INTERNAL_SERVER_ERROR
=
500
;
/**
* @var int
*/
public
const
NOT_IMPLEMENTED
=
501
;
/**
* @var int
*/
public
const
BAD_GATEWAY
=
502
;
/**
* @var int
*/
public
const
SERVICE_UNAVAILABLE
=
503
;
/**
* @var int
*/
public
const
GATEWAY_TIMEOUT
=
504
;
/**
* @var int
*/
public
const
VERSION_NOT_SUPPORTED
=
505
;
/**
* @var int
*/
public
const
VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL
=
506
;
// RFC2295
/**
* @var int
*/
public
const
INSUFFICIENT_STORAGE
=
507
;
// RFC4918
/**
* @var int
*/
public
const
LOOP_DETECTED
=
508
;
// RFC5842
/**
* @var int
*/
public
const
NOT_EXTENDED
=
510
;
// RFC2774
/**
* @var int
*/
public
const
NETWORK_AUTHENTICATION_REQUIRED
=
511
;
// RFC6585
/**
* @var array<int, string>
*/
private
static
array
$
codes
= [
100
=>
'
Continue
'
,
102
=>
'
Processing
'
,
103
=>
'
Early Hints
'
,
200
=>
'
OK
'
,
201
=>
'
Created
'
,
202
=>
'
Accepted
'
,
203
=>
'
Non-Authoritative Information
'
,
204
=>
'
No Content
'
,
205
=>
'
Reset Content
'
,
206
=>
'
Partial Content
'
,
207
=>
'
Multi-Status
'
,
208
=>
'
Already Reported
'
,
226
=>
'
IM Used
'
,
300
=>
'
Multiple Choices
'
,
301
=>
'
Moved Permanently
'
,
302
=>
'
Found
'
,
303
=>
'
See Other
'
,
304
=>
'
Not Modified
'
,
305
=>
'
Use Proxy
'
,
306
=>
'
Reserved
'
,
307
=>
'
Temporary Redirect
'
,
308
=>
'
Permanent Redirect
'
,
400
=>
'
Bad Request
'
,
401
=>
'
Unauthorized
'
,
402
=>
'
Payment Required
'
,
403
=>
'
Forbidden
'
,
404
=>
'
Not Found
'
,
405
=>
'
Method Not Allowed
'
,
406
=>
'
Not Acceptable
'
,
407
=>
'
Proxy Authentication Required
'
,
408
=>
'
Request Timeout
'
,
409
=>
'
Conflict
'
,
410
=>
'
Gone
'
,
411
=>
'
Length Required
'
,
412
=>
'
Precondition Failed
'
,
413
=>
'
Request Entity Too Large
'
,
414
=>
'
Request-URI Too Long
'
,
415
=>
'
Unsupported Media Type
'
,
416
=>
'
Requested Range Not Satisfiable
'
,
417
=>
'
Expectation Failed
'
,
418
=>
'
Unassigned
'
,
421
=>
'
Misdirected Request
'
,
422
=>
'
Unprocessable Entity
'
,
423
=>
'
Locked
'
,
424
=>
'
Failed Dependency
'
,
425
=>
'
Too Early
'
,
426
=>
'
Upgrade Required
'
,
428
=>
'
Precondition Required
'
,
429
=>
'
Too Many Requests
'
,
431
=>
'
Request Header Fields Too Large
'
,
451
=>
'
Unavailable For Legal Reasons
'
,
500
=>
'
Internal Server Error
'
,
501
=>
'
Not Implemented
'
,
502
=>
'
Bad Gateway
'
,
503
=>
'
Service Unavailable
'
,
504
=>
'
Gateway Timeout
'
,
505
=>
'
HTTP Version Not Supported
'
,
506
=>
'
Variant Also Negotiates
'
,
507
=>
'
Insufficient Storage
'
,
508
=>
'
Loop Detected
'
,
510
=>
'
Not Extended
'
,
511
=>
'
Network Authentication Required
'
];
/**
* Returns string with HTTP code and its description
*
* ```php
* <?php
* HttpCode::getDescription(200); // '200 (OK)'
* HttpCode::getDescription(401); // '401 (Unauthorized)'
* ```
*/
public
static
function
getDescription
(
int
$
code
):
int
|
string
{
if
(
isset
(
self
::
$
codes
[
$
code
])) {
return
sprintf
(
'
%d (%s)
'
,
$
code
,
self
::
$
codes
[
$
code
]);
}
return
$
code
;
}
}
You can’t perform that action at this time.