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

Commit 3d26bc4

Browse files
committed
Add EndpointInterface
1 parent 72ce916 commit 3d26bc4

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/Dispatch/MethodDispatcher.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Usox\JsonSchemaApi\Exception\MethodNotFoundException;
1414
use Usox\JsonSchemaApi\Exception\RequestMalformedException;
1515
use Usox\JsonSchemaApi\Exception\ResponseMalformedException;
16-
use Usox\JsonSchemaApi\Dispatch\Exception\SchemaInvalidException;
1716
use Usox\JsonSchemaApi\Dispatch\Exception\SchemaNotFoundException;
1817

1918
final class MethodDispatcher implements MethodDispatcherInterface

src/Endpoint.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Psr\Http\Message\ResponseInterface;
1010
use Psr\Http\Message\ServerRequestInterface;
1111
use Psr\Http\Message\StreamFactoryInterface;
12-
use Psr\Http\Server\MiddlewareInterface;
1312
use Psr\Http\Server\RequestHandlerInterface;
1413
use Psr\Log\LoggerInterface;
1514
use Ramsey\Uuid\UuidFactory;
@@ -30,7 +29,7 @@
3029
use Usox\JsonSchemaApi\Response\ResponseBuilderInterface;
3130

3231
final class Endpoint implements
33-
MiddlewareInterface
32+
EndpointInterface
3433
{
3534
private RequestValidatorInterface $inputValidator;
3635

src/EndpointInterface.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Usox\JsonSchemaApi;
4+
5+
use Psr\Http\Message\ResponseInterface;
6+
use Psr\Http\Message\ServerRequestInterface;
7+
use Psr\Http\Server\MiddlewareInterface;
8+
9+
interface EndpointInterface extends
10+
MiddlewareInterface
11+
{
12+
public function serve(
13+
ServerRequestInterface $request,
14+
ResponseInterface $response
15+
): ResponseInterface;
16+
}

0 commit comments

Comments
 (0)