mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-06 15:40:54 +00:00
update php samples
This commit is contained in:
parent
7070255dc5
commit
5f136557ba
@ -47,7 +47,7 @@ class RegisterRoutes {
|
|||||||
\Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) {
|
\Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) {
|
||||||
$r = \Flight::request();
|
$r = \Flight::request();
|
||||||
$handler->deletePet(
|
$handler->deletePet(
|
||||||
parseParam($petId, 'int'),
|
parseParam($petId, 'int'),
|
||||||
parseParam($r->getHeader('api_key'), '?string')
|
parseParam($r->getHeader('api_key'), '?string')
|
||||||
);
|
);
|
||||||
\Flight::halt(204);
|
\Flight::halt(204);
|
||||||
@ -313,7 +313,7 @@ class RegisterRoutes {
|
|||||||
\Flight::route('GET /user/login', function () use ($handler) {
|
\Flight::route('GET /user/login', function () use ($handler) {
|
||||||
$r = \Flight::request();
|
$r = \Flight::request();
|
||||||
$result = $handler->loginUser(
|
$result = $handler->loginUser(
|
||||||
parseParam($r->query['username'] ?? null, 'string'),
|
parseParam($r->query['username'] ?? null, 'string'),
|
||||||
parseParam($r->query['password'] ?? null, 'string')
|
parseParam($r->query['password'] ?? null, 'string')
|
||||||
);
|
);
|
||||||
if ($result === null) {
|
if ($result === null) {
|
||||||
@ -343,7 +343,7 @@ class RegisterRoutes {
|
|||||||
\Flight::route('PUT /user/@username', function (string $username) use ($handler) {
|
\Flight::route('PUT /user/@username', function (string $username) use ($handler) {
|
||||||
$r = \Flight::request();
|
$r = \Flight::request();
|
||||||
$handler->updateUser(
|
$handler->updateUser(
|
||||||
parseParam($username, 'string'),
|
parseParam($username, 'string'),
|
||||||
parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User')
|
parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User')
|
||||||
);
|
);
|
||||||
\Flight::halt(204);
|
\Flight::halt(204);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user