@@ -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 | } |
@@ -33,46 +33,46 @@ |
||
| 33 | 33 | |
| 34 | 34 | class ContactsMenuController extends Controller { |
| 35 | 35 | |
| 36 | - /** @var Manager */ |
|
| 37 | - private $manager; |
|
| 36 | + /** @var Manager */ |
|
| 37 | + private $manager; |
|
| 38 | 38 | |
| 39 | - /** @var IUserSession */ |
|
| 40 | - private $userSession; |
|
| 39 | + /** @var IUserSession */ |
|
| 40 | + private $userSession; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param IRequest $request |
|
| 44 | - * @param IUserSession $userSession |
|
| 45 | - * @param Manager $manager |
|
| 46 | - */ |
|
| 47 | - public function __construct(IRequest $request, IUserSession $userSession, Manager $manager) { |
|
| 48 | - parent::__construct('core', $request); |
|
| 49 | - $this->userSession = $userSession; |
|
| 50 | - $this->manager = $manager; |
|
| 51 | - } |
|
| 42 | + /** |
|
| 43 | + * @param IRequest $request |
|
| 44 | + * @param IUserSession $userSession |
|
| 45 | + * @param Manager $manager |
|
| 46 | + */ |
|
| 47 | + public function __construct(IRequest $request, IUserSession $userSession, Manager $manager) { |
|
| 48 | + parent::__construct('core', $request); |
|
| 49 | + $this->userSession = $userSession; |
|
| 50 | + $this->manager = $manager; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @NoAdminRequired |
|
| 55 | - * |
|
| 56 | - * @param string|null filter |
|
| 57 | - * @return \JsonSerializable[] |
|
| 58 | - */ |
|
| 59 | - public function index($filter = null) { |
|
| 60 | - return $this->manager->getEntries($this->userSession->getUser(), $filter); |
|
| 61 | - } |
|
| 53 | + /** |
|
| 54 | + * @NoAdminRequired |
|
| 55 | + * |
|
| 56 | + * @param string|null filter |
|
| 57 | + * @return \JsonSerializable[] |
|
| 58 | + */ |
|
| 59 | + public function index($filter = null) { |
|
| 60 | + return $this->manager->getEntries($this->userSession->getUser(), $filter); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @NoAdminRequired |
|
| 65 | - * |
|
| 66 | - * @param integer $shareType |
|
| 67 | - * @param string $shareWith |
|
| 68 | - * @return JSONResponse|\JsonSerializable |
|
| 69 | - */ |
|
| 70 | - public function findOne($shareType, $shareWith) { |
|
| 71 | - $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith); |
|
| 63 | + /** |
|
| 64 | + * @NoAdminRequired |
|
| 65 | + * |
|
| 66 | + * @param integer $shareType |
|
| 67 | + * @param string $shareWith |
|
| 68 | + * @return JSONResponse|\JsonSerializable |
|
| 69 | + */ |
|
| 70 | + public function findOne($shareType, $shareWith) { |
|
| 71 | + $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith); |
|
| 72 | 72 | |
| 73 | - if ($contact) { |
|
| 74 | - return $contact; |
|
| 75 | - } |
|
| 76 | - return new JSONResponse([], Http::STATUS_NOT_FOUND); |
|
| 77 | - } |
|
| 73 | + if ($contact) { |
|
| 74 | + return $contact; |
|
| 75 | + } |
|
| 76 | + return new JSONResponse([], Http::STATUS_NOT_FOUND); |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | return [ |
| 24 | - 'routes' => [ |
|
| 25 | - ['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'], |
|
| 26 | - ] |
|
| 24 | + 'routes' => [ |
|
| 25 | + ['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'], |
|
| 26 | + ] |
|
| 27 | 27 | ]; |
@@ -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 | } |
@@ -28,76 +28,76 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | trait IdentifierTrait { |
| 30 | 30 | |
| 31 | - /** @var string */ |
|
| 32 | - protected $identifier; |
|
| 31 | + /** @var string */ |
|
| 32 | + protected $identifier; |
|
| 33 | 33 | |
| 34 | - /** @var string[] */ |
|
| 35 | - protected $identifierAliases = []; |
|
| 34 | + /** @var string[] */ |
|
| 35 | + protected $identifierAliases = []; |
|
| 36 | 36 | |
| 37 | - /** @var IdentifierTrait */ |
|
| 38 | - protected $deprecateTo = null; |
|
| 37 | + /** @var IdentifierTrait */ |
|
| 38 | + protected $deprecateTo = null; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @return string |
|
| 42 | - */ |
|
| 43 | - public function getIdentifier() { |
|
| 44 | - return $this->identifier; |
|
| 45 | - } |
|
| 40 | + /** |
|
| 41 | + * @return string |
|
| 42 | + */ |
|
| 43 | + public function getIdentifier() { |
|
| 44 | + return $this->identifier; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @param string $identifier |
|
| 49 | - * @return $this |
|
| 50 | - */ |
|
| 51 | - public function setIdentifier($identifier) { |
|
| 52 | - $this->identifier = $identifier; |
|
| 53 | - $this->identifierAliases[] = $identifier; |
|
| 54 | - return $this; |
|
| 55 | - } |
|
| 47 | + /** |
|
| 48 | + * @param string $identifier |
|
| 49 | + * @return $this |
|
| 50 | + */ |
|
| 51 | + public function setIdentifier($identifier) { |
|
| 52 | + $this->identifier = $identifier; |
|
| 53 | + $this->identifierAliases[] = $identifier; |
|
| 54 | + return $this; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @return string[] |
|
| 59 | - */ |
|
| 60 | - public function getIdentifierAliases() { |
|
| 61 | - return $this->identifierAliases; |
|
| 62 | - } |
|
| 57 | + /** |
|
| 58 | + * @return string[] |
|
| 59 | + */ |
|
| 60 | + public function getIdentifierAliases() { |
|
| 61 | + return $this->identifierAliases; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @param string $alias |
|
| 66 | - * @return $this |
|
| 67 | - */ |
|
| 68 | - public function addIdentifierAlias($alias) { |
|
| 69 | - $this->identifierAliases[] = $alias; |
|
| 70 | - return $this; |
|
| 71 | - } |
|
| 64 | + /** |
|
| 65 | + * @param string $alias |
|
| 66 | + * @return $this |
|
| 67 | + */ |
|
| 68 | + public function addIdentifierAlias($alias) { |
|
| 69 | + $this->identifierAliases[] = $alias; |
|
| 70 | + return $this; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * @return object|null |
|
| 75 | - */ |
|
| 76 | - public function getDeprecateTo() { |
|
| 77 | - return $this->deprecateTo; |
|
| 78 | - } |
|
| 73 | + /** |
|
| 74 | + * @return object|null |
|
| 75 | + */ |
|
| 76 | + public function getDeprecateTo() { |
|
| 77 | + return $this->deprecateTo; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * @param object $destinationObject |
|
| 82 | - * @return self |
|
| 83 | - */ |
|
| 84 | - public function deprecateTo($destinationObject) { |
|
| 85 | - $this->deprecateTo = $destinationObject; |
|
| 86 | - return $this; |
|
| 87 | - } |
|
| 80 | + /** |
|
| 81 | + * @param object $destinationObject |
|
| 82 | + * @return self |
|
| 83 | + */ |
|
| 84 | + public function deprecateTo($destinationObject) { |
|
| 85 | + $this->deprecateTo = $destinationObject; |
|
| 86 | + return $this; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * @return array |
|
| 91 | - */ |
|
| 92 | - public function jsonSerializeIdentifier() { |
|
| 93 | - $data = [ |
|
| 94 | - 'identifier' => $this->identifier, |
|
| 95 | - 'identifierAliases' => $this->identifierAliases, |
|
| 96 | - ]; |
|
| 97 | - if ($this->deprecateTo) { |
|
| 98 | - $data['deprecateTo'] = $this->deprecateTo->getIdentifier(); |
|
| 99 | - } |
|
| 100 | - return $data; |
|
| 101 | - } |
|
| 89 | + /** |
|
| 90 | + * @return array |
|
| 91 | + */ |
|
| 92 | + public function jsonSerializeIdentifier() { |
|
| 93 | + $data = [ |
|
| 94 | + 'identifier' => $this->identifier, |
|
| 95 | + 'identifierAliases' => $this->identifierAliases, |
|
| 96 | + ]; |
|
| 97 | + if ($this->deprecateTo) { |
|
| 98 | + $data['deprecateTo'] = $this->deprecateTo->getIdentifier(); |
|
| 99 | + } |
|
| 100 | + return $data; |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | 103 | } |
@@ -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 | } |