FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sentry-php/src/HttpClient/Response.php at sensitive-data-scrubber · getsentry/sentry-php · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
getsentry
/
sentry-php
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
474
Star
1.9k
Code
Issues
20
Pull requests
10
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
sentry-php
/
src
/
HttpClient
/
Response.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
91 lines (73 loc) · 1.71 KB
Breadcrumbs
sentry-php
/
src
/
HttpClient
/
Response.php
Copy path
File metadata and controls
91 lines (73 loc) · 1.71 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
<?php
declare
(strict_types=
1
);
namespace
Sentry
\
HttpClient
;
final
class
Response
{
/**
* @var int The HTTP status code
*/
private
$
statusCode
;
/**
* @var string[]
*/
private
$
headerNames
= [];
/**
* @var string[][]
*/
private
$
headers
;
/**
* @var string The cURL error and error message
*/
private
$
error
;
/**
* @param string[][] $headers
*/
public
function
__construct
(
int
$
statusCode
,
array
$
headers
,
string
$
error
)
{
$
this
->
statusCode
=
$
statusCode
;
$
this
->
headers
=
$
headers
;
$
this
->
error
=
$
error
;
foreach
(
$
headers
as
$
name
=>
$
value
) {
$
this
->
headerNames
[
strtolower
(
$
name
)] =
$
name
;
}
}
public
function
getStatusCode
():
int
{
return
$
this
->
statusCode
;
}
public
function
isSuccess
():
bool
{
return
$
this
->
statusCode
>=
200
&&
$
this
->
statusCode
<=
299
;
}
public
function
hasHeader
(
string
$
name
):
bool
{
return
isset
(
$
this
->
headerNames
[
strtolower
(
$
name
)]);
}
/**
* @return string[]
*/
public
function
getHeader
(
string
$
header
):
array
{
if
(!
$
this
->
hasHeader
(
$
header
)) {
return
[];
}
$
header
=
$
this
->
headerNames
[
strtolower
(
$
header
)];
return
$
this
->
headers
[
$
header
];
}
public
function
getHeaderLine
(
string
$
name
):
string
{
$
value
=
$
this
->
getHeader
(
$
name
);
if
(
empty
(
$
value
)) {
return
''
;
}
return
implode
(
'
,
'
,
$
value
);
}
public
function
getError
():
string
{
return
$
this
->
error
;
}
public
function
hasError
():
bool
{
return
$
this
->
error
!==
''
;
}
}
Back
|
FazBrowse Home
|
New Git URL