1 | <?php |
||
11 | class RequestBridge |
||
12 | { |
||
13 | /** |
||
14 | * Returns a new instance of \OAuth2\Request based on the given \Slim\Http\Request |
||
15 | * |
||
16 | * @param ServerRequestInterface $request The psr-7 request. |
||
17 | * |
||
18 | * @return OAuth2\Request |
||
19 | */ |
||
20 | final public static function toOAuth2(ServerRequestInterface $request) |
||
36 | |||
37 | /** |
||
38 | * Helper method to clean header keys and values. |
||
39 | * |
||
40 | * Slim will convert all headers to Camel-Case style. There are certain headers such as PHP_AUTH_USER that the |
||
41 | * OAuth2 library requires CAPS_CASE format. This method will adjust those headers as needed. The OAuth2 library |
||
42 | * also does not expect arrays for header values, this method will implode the multiple values with a ', ' |
||
43 | * |
||
44 | * @param array $uncleanHeaders The headers to be cleaned. |
||
45 | * |
||
46 | * @return array The cleaned headers |
||
47 | */ |
||
48 | private static function cleanupHeaders(array $uncleanHeaders = []) |
||
69 | |||
70 | /** |
||
71 | * Convert a PSR-7 uploaded files structure to a $_FILES structure. |
||
72 | * |
||
73 | * @param array $uploadedFiles Array of file objects. |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | private static function convertUploadedFiles(array $uploadedFiles) |
||
94 | |||
95 | private static function convertUploadedFile(UploadedFileInterface $uploadedFile) |
||
105 | } |
||
106 |