@@ -35,18 +35,18 @@ |
||
35 | 35 | */ |
36 | 36 | class GenericEncryptionException extends HintException { |
37 | 37 | |
38 | - /** |
|
39 | - * @param string $message |
|
40 | - * @param string $hint |
|
41 | - * @param int $code |
|
42 | - * @param \Exception|null $previous |
|
43 | - * @since 8.1.0 |
|
44 | - */ |
|
45 | - public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { |
|
46 | - if (empty($message)) { |
|
47 | - $message = 'Unspecified encryption exception'; |
|
48 | - } |
|
49 | - parent::__construct($message, $hint, $code, $previous); |
|
50 | - } |
|
38 | + /** |
|
39 | + * @param string $message |
|
40 | + * @param string $hint |
|
41 | + * @param int $code |
|
42 | + * @param \Exception|null $previous |
|
43 | + * @since 8.1.0 |
|
44 | + */ |
|
45 | + public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { |
|
46 | + if (empty($message)) { |
|
47 | + $message = 'Unspecified encryption exception'; |
|
48 | + } |
|
49 | + parent::__construct($message, $hint, $code, $previous); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | } |
@@ -27,15 +27,15 @@ |
||
27 | 27 | */ |
28 | 28 | class StorageAuthException extends StorageNotAvailableException { |
29 | 29 | |
30 | - /** |
|
31 | - * StorageAuthException constructor. |
|
32 | - * |
|
33 | - * @param string $message |
|
34 | - * @param \Exception|null $previous |
|
35 | - * @since 9.0.0 |
|
36 | - */ |
|
37 | - public function __construct($message = '', \Exception $previous = null) { |
|
38 | - $l = \OC::$server->getL10N('core'); |
|
39 | - parent::__construct($l->t('Storage unauthorized. %s', [$message]), self::STATUS_UNAUTHORIZED, $previous); |
|
40 | - } |
|
30 | + /** |
|
31 | + * StorageAuthException constructor. |
|
32 | + * |
|
33 | + * @param string $message |
|
34 | + * @param \Exception|null $previous |
|
35 | + * @since 9.0.0 |
|
36 | + */ |
|
37 | + public function __construct($message = '', \Exception $previous = null) { |
|
38 | + $l = \OC::$server->getL10N('core'); |
|
39 | + parent::__construct($l->t('Storage unauthorized. %s', [$message]), self::STATUS_UNAUTHORIZED, $previous); |
|
40 | + } |
|
41 | 41 | } |
@@ -27,16 +27,16 @@ |
||
27 | 27 | */ |
28 | 28 | class StorageBadConfigException extends StorageNotAvailableException { |
29 | 29 | |
30 | - /** |
|
31 | - * ExtStorageBadConfigException constructor. |
|
32 | - * |
|
33 | - * @param string $message |
|
34 | - * @param \Exception|null $previous |
|
35 | - * @since 9.0.0 |
|
36 | - */ |
|
37 | - public function __construct($message = '', \Exception $previous = null) { |
|
38 | - $l = \OC::$server->getL10N('core'); |
|
39 | - parent::__construct($l->t('Storage incomplete configuration. %s', [$message]), self::STATUS_INCOMPLETE_CONF, $previous); |
|
40 | - } |
|
30 | + /** |
|
31 | + * ExtStorageBadConfigException constructor. |
|
32 | + * |
|
33 | + * @param string $message |
|
34 | + * @param \Exception|null $previous |
|
35 | + * @since 9.0.0 |
|
36 | + */ |
|
37 | + public function __construct($message = '', \Exception $previous = null) { |
|
38 | + $l = \OC::$server->getL10N('core'); |
|
39 | + parent::__construct($l->t('Storage incomplete configuration. %s', [$message]), self::STATUS_INCOMPLETE_CONF, $previous); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | } |
@@ -32,25 +32,25 @@ |
||
32 | 32 | */ |
33 | 33 | class ForbiddenException extends \Exception { |
34 | 34 | |
35 | - /** @var bool */ |
|
36 | - private $retry; |
|
35 | + /** @var bool */ |
|
36 | + private $retry; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param string $message |
|
40 | - * @param bool $retry |
|
41 | - * @param \Exception|null $previous previous exception for cascading |
|
42 | - * @since 9.0.0 |
|
43 | - */ |
|
44 | - public function __construct($message, $retry, \Exception $previous = null) { |
|
45 | - parent::__construct($message, 0, $previous); |
|
46 | - $this->retry = $retry; |
|
47 | - } |
|
38 | + /** |
|
39 | + * @param string $message |
|
40 | + * @param bool $retry |
|
41 | + * @param \Exception|null $previous previous exception for cascading |
|
42 | + * @since 9.0.0 |
|
43 | + */ |
|
44 | + public function __construct($message, $retry, \Exception $previous = null) { |
|
45 | + parent::__construct($message, 0, $previous); |
|
46 | + $this->retry = $retry; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @return bool |
|
51 | - * @since 9.0.0 |
|
52 | - */ |
|
53 | - public function getRetry() { |
|
54 | - return (bool) $this->retry; |
|
55 | - } |
|
49 | + /** |
|
50 | + * @return bool |
|
51 | + * @since 9.0.0 |
|
52 | + */ |
|
53 | + public function getRetry() { |
|
54 | + return (bool) $this->retry; |
|
55 | + } |
|
56 | 56 | } |
@@ -27,15 +27,15 @@ |
||
27 | 27 | */ |
28 | 28 | class StorageTimeoutException extends StorageNotAvailableException { |
29 | 29 | |
30 | - /** |
|
31 | - * StorageTimeoutException constructor. |
|
32 | - * |
|
33 | - * @param string $message |
|
34 | - * @param \Exception|null $previous |
|
35 | - * @since 9.0.0 |
|
36 | - */ |
|
37 | - public function __construct($message = '', \Exception $previous = null) { |
|
38 | - $l = \OC::$server->getL10N('core'); |
|
39 | - parent::__construct($l->t('Storage connection timeout. %s', [$message]), self::STATUS_TIMEOUT, $previous); |
|
40 | - } |
|
30 | + /** |
|
31 | + * StorageTimeoutException constructor. |
|
32 | + * |
|
33 | + * @param string $message |
|
34 | + * @param \Exception|null $previous |
|
35 | + * @since 9.0.0 |
|
36 | + */ |
|
37 | + public function __construct($message = '', \Exception $previous = null) { |
|
38 | + $l = \OC::$server->getL10N('core'); |
|
39 | + parent::__construct($l->t('Storage connection timeout. %s', [$message]), self::STATUS_TIMEOUT, $previous); |
|
40 | + } |
|
41 | 41 | } |
@@ -27,15 +27,15 @@ |
||
27 | 27 | */ |
28 | 28 | class StorageConnectionException extends StorageNotAvailableException { |
29 | 29 | |
30 | - /** |
|
31 | - * StorageConnectionException constructor. |
|
32 | - * |
|
33 | - * @param string $message |
|
34 | - * @param \Exception|null $previous |
|
35 | - * @since 9.0.0 |
|
36 | - */ |
|
37 | - public function __construct($message = '', \Exception $previous = null) { |
|
38 | - $l = \OC::$server->getL10N('core'); |
|
39 | - parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous); |
|
40 | - } |
|
30 | + /** |
|
31 | + * StorageConnectionException constructor. |
|
32 | + * |
|
33 | + * @param string $message |
|
34 | + * @param \Exception|null $previous |
|
35 | + * @since 9.0.0 |
|
36 | + */ |
|
37 | + public function __construct($message = '', \Exception $previous = null) { |
|
38 | + $l = \OC::$server->getL10N('core'); |
|
39 | + parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous); |
|
40 | + } |
|
41 | 41 | } |
@@ -29,15 +29,15 @@ |
||
29 | 29 | * Authentication mechanism or backend has insufficient data |
30 | 30 | */ |
31 | 31 | class InsufficientDataForMeaningfulAnswerException extends StorageNotAvailableException { |
32 | - /** |
|
33 | - * StorageNotAvailableException constructor. |
|
34 | - * |
|
35 | - * @param string $message |
|
36 | - * @param int $code |
|
37 | - * @param \Exception|null $previous |
|
38 | - * @since 6.0.0 |
|
39 | - */ |
|
40 | - public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) { |
|
41 | - parent::__construct($message, $code, $previous); |
|
42 | - } |
|
32 | + /** |
|
33 | + * StorageNotAvailableException constructor. |
|
34 | + * |
|
35 | + * @param string $message |
|
36 | + * @param int $code |
|
37 | + * @param \Exception|null $previous |
|
38 | + * @since 6.0.0 |
|
39 | + */ |
|
40 | + public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) { |
|
41 | + parent::__construct($message, $code, $previous); |
|
42 | + } |
|
43 | 43 | } |
@@ -36,27 +36,27 @@ |
||
36 | 36 | * @since 7.0.0 |
37 | 37 | */ |
38 | 38 | class LockNotAcquiredException extends \Exception { |
39 | - /** @var string $path The path that could not be locked */ |
|
40 | - public $path; |
|
39 | + /** @var string $path The path that could not be locked */ |
|
40 | + public $path; |
|
41 | 41 | |
42 | - /** @var integer $lockType The type of the lock that was attempted */ |
|
43 | - public $lockType; |
|
42 | + /** @var integer $lockType The type of the lock that was attempted */ |
|
43 | + public $lockType; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @since 7.0.0 |
|
47 | - */ |
|
48 | - public function __construct($path, $lockType, $code = 0, \Exception $previous = null) { |
|
49 | - $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', [$lockType, $path]); |
|
50 | - parent::__construct($message, $code, $previous); |
|
51 | - } |
|
45 | + /** |
|
46 | + * @since 7.0.0 |
|
47 | + */ |
|
48 | + public function __construct($path, $lockType, $code = 0, \Exception $previous = null) { |
|
49 | + $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', [$lockType, $path]); |
|
50 | + parent::__construct($message, $code, $previous); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * custom string representation of object |
|
55 | - * |
|
56 | - * @return string |
|
57 | - * @since 7.0.0 |
|
58 | - */ |
|
59 | - public function __toString() { |
|
60 | - return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; |
|
61 | - } |
|
53 | + /** |
|
54 | + * custom string representation of object |
|
55 | + * |
|
56 | + * @return string |
|
57 | + * @since 7.0.0 |
|
58 | + */ |
|
59 | + public function __toString() { |
|
60 | + return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; |
|
61 | + } |
|
62 | 62 | } |
@@ -42,67 +42,67 @@ |
||
42 | 42 | abstract class Middleware { |
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * This is being run in normal order before the controller is being |
|
47 | - * called which allows several modifications and checks |
|
48 | - * |
|
49 | - * @param Controller $controller the controller that is being called |
|
50 | - * @param string $methodName the name of the method that will be called on |
|
51 | - * the controller |
|
52 | - * @since 6.0.0 |
|
53 | - */ |
|
54 | - public function beforeController($controller, $methodName) { |
|
55 | - } |
|
45 | + /** |
|
46 | + * This is being run in normal order before the controller is being |
|
47 | + * called which allows several modifications and checks |
|
48 | + * |
|
49 | + * @param Controller $controller the controller that is being called |
|
50 | + * @param string $methodName the name of the method that will be called on |
|
51 | + * the controller |
|
52 | + * @since 6.0.0 |
|
53 | + */ |
|
54 | + public function beforeController($controller, $methodName) { |
|
55 | + } |
|
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * This is being run when either the beforeController method or the |
|
60 | - * controller method itself is throwing an exception. The middleware is |
|
61 | - * asked in reverse order to handle the exception and to return a response. |
|
62 | - * If the response is null, it is assumed that the exception could not be |
|
63 | - * handled and the error will be thrown again |
|
64 | - * |
|
65 | - * @param Controller $controller the controller that is being called |
|
66 | - * @param string $methodName the name of the method that will be called on |
|
67 | - * the controller |
|
68 | - * @param \Exception $exception the thrown exception |
|
69 | - * @throws \Exception the passed in exception if it can't handle it |
|
70 | - * @return Response a Response object in case that the exception was handled |
|
71 | - * @since 6.0.0 |
|
72 | - */ |
|
73 | - public function afterException($controller, $methodName, \Exception $exception) { |
|
74 | - throw $exception; |
|
75 | - } |
|
58 | + /** |
|
59 | + * This is being run when either the beforeController method or the |
|
60 | + * controller method itself is throwing an exception. The middleware is |
|
61 | + * asked in reverse order to handle the exception and to return a response. |
|
62 | + * If the response is null, it is assumed that the exception could not be |
|
63 | + * handled and the error will be thrown again |
|
64 | + * |
|
65 | + * @param Controller $controller the controller that is being called |
|
66 | + * @param string $methodName the name of the method that will be called on |
|
67 | + * the controller |
|
68 | + * @param \Exception $exception the thrown exception |
|
69 | + * @throws \Exception the passed in exception if it can't handle it |
|
70 | + * @return Response a Response object in case that the exception was handled |
|
71 | + * @since 6.0.0 |
|
72 | + */ |
|
73 | + public function afterException($controller, $methodName, \Exception $exception) { |
|
74 | + throw $exception; |
|
75 | + } |
|
76 | 76 | |
77 | 77 | |
78 | - /** |
|
79 | - * This is being run after a successful controllermethod call and allows |
|
80 | - * the manipulation of a Response object. The middleware is run in reverse order |
|
81 | - * |
|
82 | - * @param Controller $controller the controller that is being called |
|
83 | - * @param string $methodName the name of the method that will be called on |
|
84 | - * the controller |
|
85 | - * @param Response $response the generated response from the controller |
|
86 | - * @return Response a Response object |
|
87 | - * @since 6.0.0 |
|
88 | - */ |
|
89 | - public function afterController($controller, $methodName, Response $response) { |
|
90 | - return $response; |
|
91 | - } |
|
78 | + /** |
|
79 | + * This is being run after a successful controllermethod call and allows |
|
80 | + * the manipulation of a Response object. The middleware is run in reverse order |
|
81 | + * |
|
82 | + * @param Controller $controller the controller that is being called |
|
83 | + * @param string $methodName the name of the method that will be called on |
|
84 | + * the controller |
|
85 | + * @param Response $response the generated response from the controller |
|
86 | + * @return Response a Response object |
|
87 | + * @since 6.0.0 |
|
88 | + */ |
|
89 | + public function afterController($controller, $methodName, Response $response) { |
|
90 | + return $response; |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | - /** |
|
95 | - * This is being run after the response object has been rendered and |
|
96 | - * allows the manipulation of the output. The middleware is run in reverse order |
|
97 | - * |
|
98 | - * @param Controller $controller the controller that is being called |
|
99 | - * @param string $methodName the name of the method that will be called on |
|
100 | - * the controller |
|
101 | - * @param string $output the generated output from a response |
|
102 | - * @return string the output that should be printed |
|
103 | - * @since 6.0.0 |
|
104 | - */ |
|
105 | - public function beforeOutput($controller, $methodName, $output) { |
|
106 | - return $output; |
|
107 | - } |
|
94 | + /** |
|
95 | + * This is being run after the response object has been rendered and |
|
96 | + * allows the manipulation of the output. The middleware is run in reverse order |
|
97 | + * |
|
98 | + * @param Controller $controller the controller that is being called |
|
99 | + * @param string $methodName the name of the method that will be called on |
|
100 | + * the controller |
|
101 | + * @param string $output the generated output from a response |
|
102 | + * @return string the output that should be printed |
|
103 | + * @since 6.0.0 |
|
104 | + */ |
|
105 | + public function beforeOutput($controller, $methodName, $output) { |
|
106 | + return $output; |
|
107 | + } |
|
108 | 108 | } |