From 5ea1c8012cd3d3f2af8c8b228ae6b2ec8b4d16e4 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sat, 13 Jul 2024 15:26:50 +0200 Subject: [PATCH] Fix documentation --- .phpdoc/guide/overview/abstractmiddleware.rst | 9 ++++----- .phpdoc/guide/overview/middlewarequeue.rst | 5 ++--- .phpdoc/guide/overview/queuerequesthandler.rst | 9 ++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.phpdoc/guide/overview/abstractmiddleware.rst b/.phpdoc/guide/overview/abstractmiddleware.rst index 759fa46..2dfd2a6 100644 --- a/.phpdoc/guide/overview/abstractmiddleware.rst +++ b/.phpdoc/guide/overview/abstractmiddleware.rst @@ -11,9 +11,8 @@ handing it over to the next middleware in line, and later processes the response middleware. Originally both methods just return their argument unchanged, so you should implement either one of them or both as needed. -The `AbstractMiddleware` implements the -`Psr\Http\Server\MiddlewareInterface `_ -following PHP-FIG's recommendation `PSR-15: HTTP Server Request Handlers `_. +The `AbstractMiddleware` implements the `Psr\Http\Server\MiddlewareInterface` following PHP-FIG's recommendation +`PSR-15: HTTP Server Request Handlers `_. Properties ========== @@ -41,7 +40,7 @@ The default method of `AbstractMiddleware` just returns the request unchanged. I have to implement your own `processRequest()` method. It takes a request object as only argument and must return a valid request object as well. Just make sure it follows PHP-FIG's standard recommendation `PSR-7: HTTP Message Interfaces `_ and implements the -`Psr\Http\Message\ServerRequestInterface `_. +`Psr\Http\Message\ServerRequestInterface`. Processing a Response --------------------- @@ -50,4 +49,4 @@ The default method of `AbstractMiddleware` just returns the response unchanged. you have to implement your own `processResponse()` method. It takes a response object as only argument and must return a valid response object as well. Just make sure it follows PHP-FIG's standard recommendation `PSR-7: HTTP Message Interfaces `_ and implements the -`Psr\Http\Message\ResponseInterface `_. +`Psr\Http\Message\ResponseInterface`. diff --git a/.phpdoc/guide/overview/middlewarequeue.rst b/.phpdoc/guide/overview/middlewarequeue.rst index d652228..038cc3a 100644 --- a/.phpdoc/guide/overview/middlewarequeue.rst +++ b/.phpdoc/guide/overview/middlewarequeue.rst @@ -9,7 +9,7 @@ MiddlewareQueue The `MiddlewareQueue` manages the middlewares involved in processing a server request. It makes sure they are called in first-in, first-out (FIFO) order, i.e. the same order they were added to the queue. It also ensures all middlewares are implementing the `PSR-15: HTTP Server Request Handlers `_ specification for the -`Psr\Http\Server\MiddlewareInterface `_. +`Psr\Http\Server\MiddlewareInterface`. When instantiating a `MiddlewareQueue` it defaults to being empty. But you can optionally pass an iterable set of middlewares to the constructor which are then put into the queue. To demonstrate, the following examples both have @@ -35,8 +35,7 @@ exactly the same result. $queue->enqueue(new MiddlewareOne()); $queue->enqueue(new MiddlewareTwo()); -The `MiddlewareQueue` is based on a -`OCC\Basics\DataStructures\StrictQueue `_. +The `MiddlewareQueue` is based on a `OCC\Basics\DataStructures\StrictQueue`. Methods ======= diff --git a/.phpdoc/guide/overview/queuerequesthandler.rst b/.phpdoc/guide/overview/queuerequesthandler.rst index a2ae33b..a59665e 100644 --- a/.phpdoc/guide/overview/queuerequesthandler.rst +++ b/.phpdoc/guide/overview/queuerequesthandler.rst @@ -10,9 +10,8 @@ The `QueueRequestHandler` is the core piece of this package. It fetches incoming queue of middlewares and finally sends the response back to the client. It also catches any exceptions not handled by a middleware and turns them into a proper HTTP error response. -The `QueueRequestHandler` implements the -`Psr\Http\Server\RequestHandlerInterface `_ -following PHP-FIG's recommendation `PSR-15: HTTP Server Request Handlers `_. +The `QueueRequestHandler` implements the `Psr\Http\Server\RequestHandlerInterface` following PHP-FIG's recommendation +`PSR-15: HTTP Server Request Handlers `_. For a minimal working example have a look at :doc:`../usage/usage`. @@ -58,7 +57,7 @@ HTTP Server Request The server request is always available as `QueueRequestHandler::request`. It follows PHP-FIG's standard recommendation `PSR-7: HTTP Message Interfaces `_ and implements the -`Psr\Http\Message\ServerRequestInterface `_. +`Psr\Http\Message\ServerRequestInterface`. When instantiating a `QueueRequestHandler` the `$request` property is initially set by fetching the actual server request data from superglobals. The property is reset each time the request is passed through a middleware and thus @@ -69,7 +68,7 @@ HTTP Response The response can be read as `QueueRequestHandler::response`. It also follows PHP-FIG's standard recommendation `PSR-7: HTTP Message Interfaces `_ and implements the -`Psr\Http\Message\ResponseInterface `_. +`Psr\Http\Message\ResponseInterface`. When instantiating a `QueueRequestHandler` the `$response` property is initially set as a blank HTTP response with status code `200`. The property is reset each time the response is passed through a middleware and thus