diff options
author | Olivier Paroz <github@oparoz.com> | 2015-01-11 17:09:58 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-01-11 17:09:58 +0300 |
commit | 229cb7831b9ff9021828465693feae72099bf4c0 (patch) | |
tree | e0cce3be5fd403a4adc29926d1d90a2ecd0abe28 /middleware | |
parent | f3c6b4895236b0b2ccf4e093fa73c58dc917e3c3 (diff) |
Relaxed the column width
The PSR2 coding guidelines say that 80 is a soft limit and that the hard limit is at 120, so I'm allowing some lines to be longer than 80 to improve readability
Some methods were also refactored slightly
Diffstat (limited to 'middleware')
-rw-r--r-- | middleware/checkmiddleware.php | 4 | ||||
-rw-r--r-- | middleware/sessionmiddleware.php | 7 | ||||
-rw-r--r-- | middleware/sharingcheckmiddleware.php | 8 |
3 files changed, 5 insertions, 14 deletions
diff --git a/middleware/checkmiddleware.php b/middleware/checkmiddleware.php index c3523231..d133797f 100644 --- a/middleware/checkmiddleware.php +++ b/middleware/checkmiddleware.php @@ -76,9 +76,7 @@ abstract class CheckMiddleware extends Middleware { * * @inheritDoc */ - public function afterException( - $controller, $methodName, \Exception $exception - ) { + public function afterException($controller, $methodName, \Exception $exception) { if ($exception instanceof CheckException) { $message = $exception->getMessage(); $code = $exception->getCode(); diff --git a/middleware/sessionmiddleware.php b/middleware/sessionmiddleware.php index 0e6be5f2..5f319df3 100644 --- a/middleware/sessionmiddleware.php +++ b/middleware/sessionmiddleware.php @@ -83,13 +83,8 @@ class SessionMiddleware extends Middleware { * * @inheritDoc */ - public function afterController( - $controller, - $methodName, - Response $response - ) { + public function afterController($controller, $methodName, Response $response) { $useSession = $this->reflector->hasAnnotation('UseSession'); - if ($useSession) { $this->session->close(); } diff --git a/middleware/sharingcheckmiddleware.php b/middleware/sharingcheckmiddleware.php index 5e353666..cba1b182 100644 --- a/middleware/sharingcheckmiddleware.php +++ b/middleware/sharingcheckmiddleware.php @@ -99,15 +99,13 @@ class SharingCheckMiddleware extends CheckMiddleware { } /** - * Checks whether sharing is enabled in the OC config + * Checks whether public sharing (via links) is enabled * * @return bool */ private function isSharingEnabled() { - // Check whether public sharing (via links) is enabled - if ($this->appConfig->getValue('core', 'shareapi_allow_links', 'yes') - !== 'yes' - ) { + $shareApiAllowLinks = $this->appConfig->getValue('core', 'shareapi_allow_links', 'yes'); + if ($shareApiAllowLinks !== 'yes') { return false; } |