Update docblocks and fix typos

This commit is contained in:
PJ Dietz 2015-06-02 19:45:14 -04:00
parent 4429d4280b
commit 6f33eab90b
5 changed files with 17 additions and 16 deletions

View File

@ -44,7 +44,7 @@ class DispatchStack implements DispatchStackInterface
* *
* When the stack is dispatched empty, or when all middleware in the stack * When the stack is dispatched empty, or when all middleware in the stack
* call the $next argument they were passed, this method will call the * call the $next argument they were passed, this method will call the
* $next it receieved. * $next it received.
* *
* When any middleware in the stack returns a response without calling its * When any middleware in the stack returns a response without calling its
* $next, the stack will not call the $next it received. * $next, the stack will not call the $next it received.

View File

@ -32,16 +32,16 @@ interface DispatchStackInterface extends MiddlewareInterface
* returns the response unchanged. * returns the response unchanged.
* *
* When any middleware returns a response without calling the $next * When any middleware returns a response without calling the $next
* argument it recieved, the stack instance MUST stop propogating and MUST * argument it received, the stack instance MUST stop propagating and MUST
* return a response without calling the $next argument passed to __invoke. * return a response without calling the $next argument passed to __invoke.
* *
* This method MUST call the passed $next argument when: * This method MUST call the passed $next argument when:
* - The stack is empty (i.e., there is no middleware to dispatch) * - The stack is empty (i.e., there is no middleware to dispatch)
* - Each middleware called the $next that it receieved. * - Each middleware called the $next that it received.
* *
* This method MUST NOT call the passed $next argument when the stack is * This method MUST NOT call the passed $next argument when the stack is
* not empty and any middleware returns a response without calling the * not empty and any middleware returns a response without calling the
* $next it receieved. * $next it received.
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request
* @param ResponseInterface $response * @param ResponseInterface $response

View File

@ -29,7 +29,7 @@ interface DispatcherInterface
* *
* Implementation MAY dispatch other types of middleware. * Implementation MAY dispatch other types of middleware.
* *
* When an implementation receives a $middware that is not of a type it can * When an implementation receives a $middleware that is not of a type it can
* dispatch, it MUST throw a DispatchException. * dispatch, it MUST throw a DispatchException.
* *
* @param mixed $middleware * @param mixed $middleware

View File

@ -17,17 +17,18 @@ interface MiddlewareInterface
* $next is a callable that expects a request and response as parameters * $next is a callable that expects a request and response as parameters
* and returns a response. Calling $next forwards a request and response * and returns a response. Calling $next forwards a request and response
* to the next middleware in the sequence (if any) and continues * to the next middleware in the sequence (if any) and continues
* propagation; returning a response without calling $next halts propgation * propagation; returning a response without calling $next halts
* and prevents subsequent middleware from running. * propagation and prevents subsequent middleware from running.
* *
* Implementations MAY call $next to continue propagation. After calling * Implementations SHOULD call $next to allow subsequent middleware to act
* $next, implementations MUST return the response returned by $next or * on the request and response. Implementations MAY further alter the
* use $next's returned response to determine the response it will * response returned by $next before returning it.
* ulitimately return. Implementations MUST NOT call $next and disregard
* $next's returned response.
* *
* Implementaitons MAY return a response without calling $next to halt * Implementations MAY return a response without calling $next to prevent
* propagation. * propagation (e.g., for error conditions).
*
* Implementations SHOULD NOT call $next and disregard the response by
* returning an entirely unrelated response.
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request
* @param ResponseInterface $response * @param ResponseInterface $response

View File

@ -28,7 +28,7 @@ class Transmitter implements TransmitterInterface
* *
* This method will also provide a Content-length header if: * This method will also provide a Content-length header if:
* - Response does not have a Content-length header * - Response does not have a Content-length header
* - Response does not have a Tranfser-encoding: chunked header * - Response does not have a Transfer-encoding: chunked header
* - Response body stream is readable and reports a non-null size * - Response body stream is readable and reports a non-null size
* *
* @param ServerRequestInterface $request * @param ServerRequestInterface $request
@ -69,7 +69,7 @@ class Transmitter implements TransmitterInterface
// Add a Content-length header to the response when all of these are true: // Add a Content-length header to the response when all of these are true:
// //
// - Response does not have a Content-length header // - Response does not have a Content-length header
// - Response does not have a Tranfser-encoding: chunked header // - Response does not have a Transfer-encoding: chunked header
// - Response body stream is readable and reports a non-null size // - Response body stream is readable and reports a non-null size
// //
if (!$response->hasHeader("Content-length") if (!$response->hasHeader("Content-length")