@@ -147,7 +147,7 @@ |
||
147 | 147 | public function getFolder(Path $p) |
148 | 148 | { |
149 | 149 | $folderPath = $this->baseDir.$p->getPath(); |
150 | - $entries = glob($folderPath.'*', GLOB_ERR | GLOB_MARK); |
|
150 | + $entries = glob($folderPath.'*', GLOB_ERR|GLOB_MARK); |
|
151 | 151 | if (false === $entries) { |
152 | 152 | // directory does not exist, return empty list |
153 | 153 | return array(); |
@@ -32,6 +32,9 @@ discard block |
||
32 | 32 | /** @var string */ |
33 | 33 | private $serverMode; |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $serverMode |
|
37 | + */ |
|
35 | 38 | public function __construct(RemoteStorage $remoteStorage, $serverMode) |
36 | 39 | { |
37 | 40 | $this->remoteStorage = $remoteStorage; |
@@ -51,6 +54,9 @@ discard block |
||
51 | 54 | return $response; |
52 | 55 | } |
53 | 56 | |
57 | + /** |
|
58 | + * @param TokenInfo $tokenInfo |
|
59 | + */ |
|
54 | 60 | public function head(Request $request, $tokenInfo) |
55 | 61 | { |
56 | 62 | // XXX return headers only? |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | return false; |
419 | 419 | } |
420 | 420 | |
421 | - private function addCors(Response &$response) |
|
421 | + private function addCors(Response&$response) |
|
422 | 422 | { |
423 | 423 | $response->addHeader('Access-Control-Allow-Origin', '*'); |
424 | 424 | $response->addHeader( |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | ); |
428 | 428 | } |
429 | 429 | |
430 | - private function addNoCache(Response &$response) |
|
430 | + private function addNoCache(Response&$response) |
|
431 | 431 | { |
432 | 432 | $response->addHeader('Expires', '0'); |
433 | 433 | $response->addHeader('Cache-Control', 'no-cache'); |
@@ -55,6 +55,9 @@ discard block |
||
55 | 55 | return 200 <= $this->statusCode && 300 > $this->statusCode; |
56 | 56 | } |
57 | 57 | |
58 | + /** |
|
59 | + * @param string $key |
|
60 | + */ |
|
58 | 61 | public function addHeader($key, $value) |
59 | 62 | { |
60 | 63 | $this->headers[$key] = $value; |
@@ -94,6 +97,9 @@ discard block |
||
94 | 97 | return $output; |
95 | 98 | } |
96 | 99 | |
100 | + /** |
|
101 | + * @param string $fileName |
|
102 | + */ |
|
97 | 103 | public function setFile($fileName) |
98 | 104 | { |
99 | 105 | $this->addHeader('X-SENDFILE', $fileName); |
@@ -144,7 +144,7 @@ |
||
144 | 144 | |
145 | 145 | // XXX we also should enforce HTTPS |
146 | 146 | $redirectUri = $request->getQueryParameter('redirect_uri'); |
147 | - if (false === filter_var($redirectUri, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) { |
|
147 | + if (false === filter_var($redirectUri, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED|FILTER_FLAG_HOST_REQUIRED|FILTER_FLAG_PATH_REQUIRED)) { |
|
148 | 148 | throw new HttpException('invalid redirect_uri', 400); |
149 | 149 | } |
150 | 150 | if (false !== strpos($redirectUri, '?')) { |
@@ -56,7 +56,7 @@ |
||
56 | 56 | return $this->apiModule->head($request, $tokenInfo); |
57 | 57 | default: |
58 | 58 | throw new HttpException('', 405); |
59 | - } |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | private function handleGet(Request $request) |
@@ -79,7 +79,7 @@ |
||
79 | 79 | $redirectTo = $request->getPostParameter('_form_auth_redirect_to'); |
80 | 80 | |
81 | 81 | // validate the URL |
82 | - if (false === filter_var($redirectTo, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) { |
|
82 | + if (false === filter_var($redirectTo, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED|FILTER_FLAG_HOST_REQUIRED|FILTER_FLAG_PATH_REQUIRED)) { |
|
83 | 83 | throw new HttpException('invalid redirect_to URL', 400); |
84 | 84 | } |
85 | 85 | // extract the "host" part of the URL |