Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4103583
TranslationQueryResponse.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
TranslationQueryResponse.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\WebService
;
/**
* Value object that represents a HTTP(S) query response.
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2015.02
*/
class
TranslationQueryResponse
{
private
int
$code
;
private
string
$reason
;
private
array
$headers
;
private
?
string
$body
;
private
string
$error
;
/** @var TranslationQuery */
private
$query
;
public
function
__construct
(
array
$data
,
TranslationQuery
$query
)
{
$response
=
$data
[
'response'
];
$this
->
code
=
(
int
)
$response
[
'code'
];
$this
->
reason
=
$response
[
'reason'
];
$this
->
headers
=
$response
[
'headers'
];
$this
->
body
=
$response
[
'body'
];
$this
->
error
=
$response
[
'error'
];
$this
->
query
=
$query
;
}
public
function
getStatusCode
():
int
{
return
$this
->
code
;
}
public
function
getStatusMessage
():
string
{
if
(
$this
->
code
===
0
)
{
return
$this
->
error
;
}
else
{
return
$this
->
reason
;
}
}
public
function
getBody
():
?
string
{
return
$this
->
body
;
}
/**
* Get the TranslationQuery that was made for this request.
* @since 2017.04
*/
public
function
getQuery
():
TranslationQuery
{
return
$this
->
query
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 18:03 (3 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a7/e3/f617615c7da9eb0a1c620556e379
Default Alt Text
TranslationQueryResponse.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment