forked from loafle/openapi-generator-original
Update PHP samples
This commit is contained in:
parent
5902af4e75
commit
4c81563708
@ -549,18 +549,6 @@ class FakeApi
|
|||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
|
|
||||||
if ($statusCode < 200 || $statusCode > 299) {
|
|
||||||
throw new ApiException(
|
|
||||||
sprintf(
|
|
||||||
'[%d] Error connecting to the API (%s)',
|
|
||||||
$statusCode,
|
|
||||||
(string) $request->getUri()
|
|
||||||
),
|
|
||||||
$statusCode,
|
|
||||||
$response->getHeaders(),
|
|
||||||
(string) $response->getBody()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($statusCode) {
|
switch($statusCode) {
|
||||||
case 200:
|
case 200:
|
||||||
@ -592,6 +580,19 @@ class FakeApi
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($statusCode < 200 || $statusCode > 299) {
|
||||||
|
throw new ApiException(
|
||||||
|
sprintf(
|
||||||
|
'[%d] Error connecting to the API (%s)',
|
||||||
|
$statusCode,
|
||||||
|
(string) $request->getUri()
|
||||||
|
),
|
||||||
|
$statusCode,
|
||||||
|
$response->getHeaders(),
|
||||||
|
(string) $response->getBody()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$returnType = '\OpenAPI\Client\Model\EnumClass';
|
$returnType = '\OpenAPI\Client\Model\EnumClass';
|
||||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||||
$content = $response->getBody(); //stream goes to serializer
|
$content = $response->getBody(); //stream goes to serializer
|
||||||
|
@ -529,18 +529,6 @@ class FakeApi
|
|||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
|
|
||||||
if ($statusCode < 200 || $statusCode > 299) {
|
|
||||||
throw new ApiException(
|
|
||||||
sprintf(
|
|
||||||
'[%d] Error connecting to the API (%s)',
|
|
||||||
$statusCode,
|
|
||||||
(string) $request->getUri()
|
|
||||||
),
|
|
||||||
$statusCode,
|
|
||||||
$response->getHeaders(),
|
|
||||||
(string) $response->getBody()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($statusCode) {
|
switch($statusCode) {
|
||||||
case 200:
|
case 200:
|
||||||
@ -572,6 +560,19 @@ class FakeApi
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($statusCode < 200 || $statusCode > 299) {
|
||||||
|
throw new ApiException(
|
||||||
|
sprintf(
|
||||||
|
'[%d] Error connecting to the API (%s)',
|
||||||
|
$statusCode,
|
||||||
|
(string) $request->getUri()
|
||||||
|
),
|
||||||
|
$statusCode,
|
||||||
|
$response->getHeaders(),
|
||||||
|
(string) $response->getBody()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$returnType = '\OpenAPI\Client\Model\EnumClass';
|
$returnType = '\OpenAPI\Client\Model\EnumClass';
|
||||||
if ($returnType === '\SplFileObject') {
|
if ($returnType === '\SplFileObject') {
|
||||||
$content = $response->getBody(); //stream goes to serializer
|
$content = $response->getBody(); //stream goes to serializer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user