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 $override = 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 | * @param bool $override |
||
40 | * |
||
41 | * @return self |
||
42 | */ |
||
43 | public function override($override = true) |
||
49 | |||
50 | /** |
||
51 | * Execute the middleware. |
||
52 | * |
||
53 | * @param ServerRequestInterface $request |
||
54 | * @param ResponseInterface $response |
||
55 | * @param callable $next |
||
56 | * |
||
57 | * @return ResponseInterface |
||
58 | */ |
||
59 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
80 | } |
||
81 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.