@@ -94,6 +94,9 @@ |
||
| 94 | 94 | return $output; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | + /** |
|
| 98 | + * @param string $fileName |
|
| 99 | + */ |
|
| 97 | 100 | public function setFile($fileName) |
| 98 | 101 | { |
| 99 | 102 | $this->addHeader('X-SENDFILE', $fileName); |
@@ -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'); |
@@ -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 |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | public function getFolder(Path $p) |
| 156 | 156 | { |
| 157 | 157 | $folderPath = $this->baseDir.$p->getPath(); |
| 158 | - $entries = glob($folderPath.'*', GLOB_ERR | GLOB_MARK); |
|
| 158 | + $entries = glob($folderPath.'*', GLOB_ERR|GLOB_MARK); |
|
| 159 | 159 | if (false === $entries) { |
| 160 | 160 | // directory does not exist, return empty list |
| 161 | 161 | return []; |
@@ -27,6 +27,9 @@ |
||
| 27 | 27 | { |
| 28 | 28 | private $baseDir; |
| 29 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $baseDir |
|
| 32 | + */ |
|
| 30 | 33 | public function __construct($baseDir) |
| 31 | 34 | { |
| 32 | 35 | // check if baseDir exists, if not, try to create it |
@@ -34,10 +34,6 @@ |
||
| 34 | 34 | private $auth = []; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * @param string $configFile |
|
| 38 | - * @param string $storageRoot |
|
| 39 | - * @param string $dbDsn |
|
| 40 | - * @param array $templateFolders |
|
| 41 | 37 | */ |
| 42 | 38 | public function __construct($appDir, SessionInterface $session, RandomInterface $random, DateTime $dateTime) |
| 43 | 39 | { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | return $this->apiModule->head($request, $tokenInfo); |
| 60 | 60 | default: |
| 61 | 61 | throw new HttpException('method not allowed', 405); |
| 62 | - } |
|
| 62 | + } |
|
| 63 | 63 | } catch (HttpException $e) { |
| 64 | 64 | if ($request->isBrowser()) { |
| 65 | 65 | $response = new Response($e->getCode(), 'text/html'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | private $dateTime; |
| 43 | 43 | |
| 44 | 44 | /** @var int */ |
| 45 | - private $expiresIn = 7776000; /* 90 days */ |
|
| 45 | + private $expiresIn = 7776000; /* 90 days */ |
|
| 46 | 46 | |
| 47 | 47 | public function __construct(TplInterface $tpl, TokenStorage $tokenStorage, RandomInterface $random, DateTime $dateTime) |
| 48 | 48 | { |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | // XXX we also should enforce HTTPS |
| 167 | 167 | $redirectUri = $request->getQueryParameter('redirect_uri'); |
| 168 | - if (false === filter_var($redirectUri, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) { |
|
| 168 | + if (false === filter_var($redirectUri, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED|FILTER_FLAG_HOST_REQUIRED|FILTER_FLAG_PATH_REQUIRED)) { |
|
| 169 | 169 | throw new HttpException('invalid redirect_uri', 400); |
| 170 | 170 | } |
| 171 | 171 | if (false !== strpos($redirectUri, '?')) { |