1 | <?php |
||
11 | trait AttributeTrait |
||
12 | { |
||
13 | /** |
||
14 | * Store an attribute in the request. |
||
15 | * |
||
16 | * @param ServerRequestInterface $request |
||
17 | * @param string $name |
||
18 | * @param mixed $value |
||
19 | * |
||
20 | * @return ServerRequestInterface |
||
21 | */ |
||
22 | private static function setAttribute(ServerRequestInterface $request, $name, $value) |
||
29 | |||
30 | /** |
||
31 | * Retrieves an attribute from the request. |
||
32 | * |
||
33 | * @param ServerRequestInterface $request |
||
34 | * @param string $name |
||
35 | * @param mixed|null $default |
||
36 | * |
||
37 | * @return mixed|null |
||
38 | */ |
||
39 | private static function getAttribute(ServerRequestInterface $request, $name, $default = null) |
||
49 | |||
50 | /** |
||
51 | * Check whether an attribute exists. |
||
52 | * |
||
53 | * @param ServerRequestInterface $request |
||
54 | * @param string $name |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | private static function hasAttribute(ServerRequestInterface $request, $name) |
||
68 | } |
||
69 |