1 | <?php |
||
10 | class RequestBridge |
||
11 | { |
||
12 | /** |
||
13 | * Returns a new instance of \OAuth2\Request based on the given \Slim\Http\Request |
||
14 | * |
||
15 | * @param ServerRequestInterface $request The psr-7 request. |
||
16 | * |
||
17 | * @return OAuth2\Request |
||
18 | */ |
||
19 | final public static function toOAuth2(ServerRequestInterface $request) |
||
32 | |||
33 | /** |
||
34 | * Helper method to clean header keys and values. |
||
35 | * |
||
36 | * Slim will convert all headers to Camel-Case style. There are certain headers such as PHP_AUTH_USER that the |
||
37 | * OAuth2 library requires CAPS_CASE format. This method will adjust those headers as needed. The OAuth2 library |
||
38 | * also does not expect arrays for header values, this method will implode the multiple values with a ', ' |
||
39 | * |
||
40 | * @param array $uncleanHeaders The headers to be cleaned. |
||
41 | * |
||
42 | * @return array The cleaned headers |
||
43 | */ |
||
44 | private static function cleanupHeaders(array $uncleanHeaders = []) |
||
64 | |||
65 | /** |
||
|
|||
66 | * Convert a PSR-7 uploaded files structure to a $_FILES structure |
||
67 | * |
||
68 | * @param \Psr\Http\Message\UploadedFileInterface[] |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | private static function convertUploadedFiles(array $uploadedFiles) |
||
87 | } |
||
88 |