| Total Complexity | 8 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 91.67% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Request |
||
| 8 | { |
||
| 9 | 72 | public static function var(ServerRequestInterface $request, $param) |
|
| 10 | { |
||
| 11 | 72 | $request = static::getArgs($request); |
|
| 12 | |||
| 13 | 72 | return $request[$param] ?? null; |
|
| 14 | } |
||
| 15 | |||
| 16 | 72 | public static function has(ServerRequestInterface $request, $param): bool |
|
| 21 | } |
||
| 22 | |||
| 23 | 3 | public static function attr(ServerRequestInterface $request, $attribute) |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | public static function hasAttr(ServerRequestInterface $request, $attribute): bool |
|
| 29 | { |
||
| 30 | 3 | $attributes = $request->getAttributes(); |
|
| 31 | |||
| 32 | 3 | return isset($attributes[$attribute]); |
|
| 33 | } |
||
| 34 | |||
| 35 | 99 | public static function getArgs(ServerRequestInterface $request): array |
|
| 55 | } |
||
| 56 | |||
| 57 | public static function getParams(ServerRequestInterface $request): array |
||
| 62 |