Skip to content

Commit

Permalink
update php samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Apr 29, 2024
1 parent 7070255 commit 5f13655
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/server/petstore/php-flight/RegisterRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static public function registerRoutes(\OpenAPIServer\Api\AbstractPetApi|\OpenAPI
\Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) {
$r = \Flight::request();
$handler->deletePet(
parseParam($petId, 'int'),
parseParam($petId, 'int'),
parseParam($r->getHeader('api_key'), '?string')
);
\Flight::halt(204);
Expand Down Expand Up @@ -313,7 +313,7 @@ static public function registerRoutes(\OpenAPIServer\Api\AbstractPetApi|\OpenAPI
\Flight::route('GET /user/login', function () use ($handler) {
$r = \Flight::request();
$result = $handler->loginUser(
parseParam($r->query['username'] ?? null, 'string'),
parseParam($r->query['username'] ?? null, 'string'),
parseParam($r->query['password'] ?? null, 'string')
);
if ($result === null) {
Expand Down Expand Up @@ -343,7 +343,7 @@ static public function registerRoutes(\OpenAPIServer\Api\AbstractPetApi|\OpenAPI
\Flight::route('PUT /user/@username', function (string $username) use ($handler) {
$r = \Flight::request();
$handler->updateUser(
parseParam($username, 'string'),
parseParam($username, 'string'),
parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User')
);
\Flight::halt(204);
Expand Down

0 comments on commit 5f13655

Please sign in to comment.