1 | <?php |
||
13 | class Payload |
||
14 | { |
||
15 | use Utils\ResolverTrait; |
||
16 | |||
17 | /** @var mixed[] */ |
||
18 | private $options; |
||
19 | |||
20 | /** |
||
21 | * @var bool Whether or not Middleware\Payload has precedence over existing parsed bodies. |
||
22 | */ |
||
23 | private $overrideExistingParsedBody = false; |
||
24 | |||
25 | /** |
||
26 | * Payload constructor. |
||
27 | * |
||
28 | * @param mixed[] $options |
||
29 | */ |
||
30 | public function __construct(array $options = []) |
||
34 | |||
35 | /** |
||
36 | * If the Request object already has a parsedBody, normally Payload will skip parsing. This is not always |
||
37 | * desirable behavior. Calling this setter allows you to override this behavior. |
||
38 | */ |
||
39 | public function overrideExistingParsedBody() |
||
43 | |||
44 | /** |
||
45 | * Execute the middleware. |
||
46 | * |
||
47 | * @param ServerRequestInterface $request |
||
48 | * @param ResponseInterface $response |
||
49 | * @param callable $next |
||
50 | * |
||
51 | * @return ResponseInterface |
||
52 | */ |
||
53 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
74 | } |
||
75 |