Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 04bb0bd

Browse files
committed
Update the exmaple code
1 parent 248bb13 commit 04bb0bd

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

example/index.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
declare(strict_types=1);
44

5-
use Laminas\Diactoros\ResponseFactory;
65
use Psr\Http\Message\ServerRequestInterface;
76
use Usox\JsonSchemaApi\Contract\ApiMethodInterface;
87
use Usox\JsonSchemaApi\Contract\MethodProviderInterface;
@@ -63,17 +62,10 @@ public function lookup(string $methodName): ?ApiMethodInterface
6362
);
6463

6564

66-
$endpoint = Endpoint::factory(
67-
$methodContainer
68-
);
69-
$response = $endpoint->serve(
70-
$request,
71-
(new ResponseFactory())->createResponse()
72-
);
73-
65+
// Create the endpoint and retrieve the response
66+
$response = Endpoint::factory($methodContainer)->serve($request);
7467

7568
// Just boilerplate code. Any framework (like slim) will to that for you
76-
7769
$statusLine = sprintf(
7870
'HTTP/%s %s %s',
7971
$response->getProtocolVersion(),

0 commit comments

Comments
 (0)