1 | <?php |
||
31 | trait MessageHelper |
||
32 | { |
||
33 | /** |
||
34 | * Gets a `Map` of the request body content. |
||
35 | * |
||
36 | * @param $request - The request |
||
37 | * @return array<string,mixed> The Map of request body content |
||
38 | */ |
||
39 | 2 | protected function getParsedBodyMap(Request $request): \ConstMap |
|
44 | |||
45 | /** |
||
46 | * Gets a `Map` of the request query params. |
||
47 | * |
||
48 | * @param $request - The request |
||
49 | * @return array<string,mixed> The Map of query params |
||
50 | */ |
||
51 | protected function getQueryParamsMap(Request $request): \ConstMap |
||
55 | |||
56 | /** |
||
57 | * Cleanly writes the body to the response. |
||
58 | * |
||
59 | * @param $response - The HTTP response |
||
60 | * @param $body - The body to write |
||
61 | * @return - The same or new response |
||
|
|||
62 | */ |
||
63 | 1 | protected function write(Response $response, $body): Response |
|
68 | |||
69 | /** |
||
70 | * Checks the `If-Modified-Since` header, maybe sending 304 Not Modified. |
||
71 | * |
||
72 | * @param $request - The HTTP request |
||
73 | * @param $response - The HTTP response |
||
74 | * @param $timestamp - The timestamp for comparison |
||
75 | * @return - The same or new response |
||
76 | */ |
||
77 | 3 | protected function ifModSince(Request $request, Response $response, int $timestamp): Response |
|
85 | |||
86 | /** |
||
87 | * Checks the `If-None-Match` header, maybe sending 304 Not Modified. |
||
88 | * |
||
89 | * @param $request - The HTTP request |
||
90 | * @param $response - The HTTP response |
||
91 | * @param $etag - The ETag for comparison |
||
92 | * @return - The same or new response |
||
93 | */ |
||
94 | 3 | protected function ifNoneMatch(Request $request, Response $response, string $etag): Response |
|
102 | |||
103 | /** |
||
104 | * Redirects the user to another URL. |
||
105 | * |
||
106 | * @param $response - The HTTP response |
||
107 | * @return - The new response |
||
108 | */ |
||
109 | 1 | protected function redirect(Response $response, int $code, string $url): Response |
|
113 | |||
114 | /** |
||
115 | * Gets the stored principal, or the anonymous user if none was found. |
||
116 | * |
||
117 | * @param $request - The HTTP request |
||
118 | * @return - The authenticated principal |
||
119 | */ |
||
120 | protected function getPrincipal(Request $request): Principal |
||
128 | |||
129 | /** |
||
130 | * Gets a pagination factory |
||
131 | * |
||
132 | * @return - The pagination factory |
||
133 | */ |
||
134 | 1 | protected function paginationFactory(): PaginationFactory |
|
138 | } |
||
139 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.