@@ -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 | ]; |
@@ -31,129 +31,129 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | trait FrontendDefinitionTrait { |
| 33 | 33 | |
| 34 | - /** @var string human-readable mechanism name */ |
|
| 35 | - private $text; |
|
| 36 | - |
|
| 37 | - /** @var DefinitionParameter[] parameters for mechanism */ |
|
| 38 | - private $parameters = []; |
|
| 39 | - |
|
| 40 | - /** @var string[] custom JS */ |
|
| 41 | - private $customJs = []; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * @return string |
|
| 45 | - */ |
|
| 46 | - public function getText() { |
|
| 47 | - return $this->text; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @param string $text |
|
| 52 | - * @return $this |
|
| 53 | - */ |
|
| 54 | - public function setText($text) { |
|
| 55 | - $this->text = $text; |
|
| 56 | - return $this; |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @param FrontendDefinitionTrait $a |
|
| 61 | - * @param FrontendDefinitionTrait $b |
|
| 62 | - * @return int |
|
| 63 | - */ |
|
| 64 | - public static function lexicalCompare(FrontendDefinitionTrait $a, FrontendDefinitionTrait $b) { |
|
| 65 | - return strcmp($a->getText(), $b->getText()); |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * @return DefinitionParameter[] |
|
| 70 | - */ |
|
| 71 | - public function getParameters() { |
|
| 72 | - return $this->parameters; |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * @param DefinitionParameter[] $parameters |
|
| 77 | - * @return self |
|
| 78 | - */ |
|
| 79 | - public function addParameters(array $parameters) { |
|
| 80 | - foreach ($parameters as $parameter) { |
|
| 81 | - $this->addParameter($parameter); |
|
| 82 | - } |
|
| 83 | - return $this; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * @param DefinitionParameter $parameter |
|
| 88 | - * @return self |
|
| 89 | - */ |
|
| 90 | - public function addParameter(DefinitionParameter $parameter) { |
|
| 91 | - $this->parameters[$parameter->getName()] = $parameter; |
|
| 92 | - return $this; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * @return string[] |
|
| 97 | - */ |
|
| 98 | - public function getCustomJs() { |
|
| 99 | - return $this->customJs; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @param string $custom |
|
| 104 | - * @return self |
|
| 105 | - */ |
|
| 106 | - public function addCustomJs($custom) { |
|
| 107 | - $this->customJs[] = $custom; |
|
| 108 | - return $this; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @param string $custom |
|
| 113 | - * @return self |
|
| 114 | - * @deprecated 9.1.0, use addCustomJs() instead |
|
| 115 | - */ |
|
| 116 | - public function setCustomJs($custom) { |
|
| 117 | - $this->customJs = [$custom]; |
|
| 118 | - return $this; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * Serialize into JSON for client-side JS |
|
| 123 | - * |
|
| 124 | - * @return array |
|
| 125 | - */ |
|
| 126 | - public function jsonSerializeDefinition() { |
|
| 127 | - $configuration = []; |
|
| 128 | - foreach ($this->getParameters() as $parameter) { |
|
| 129 | - $configuration[$parameter->getName()] = $parameter; |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - $data = [ |
|
| 133 | - 'name' => $this->getText(), |
|
| 134 | - 'configuration' => $configuration, |
|
| 135 | - 'custom' => $this->getCustomJs(), |
|
| 136 | - ]; |
|
| 137 | - return $data; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - /** |
|
| 141 | - * Check if parameters are satisfied in a StorageConfig |
|
| 142 | - * |
|
| 143 | - * @param StorageConfig $storage |
|
| 144 | - * @return bool |
|
| 145 | - */ |
|
| 146 | - public function validateStorageDefinition(StorageConfig $storage) { |
|
| 147 | - foreach ($this->getParameters() as $name => $parameter) { |
|
| 148 | - $value = $storage->getBackendOption($name); |
|
| 149 | - if (!is_null($value) || !$parameter->isOptional()) { |
|
| 150 | - if (!$parameter->validateValue($value)) { |
|
| 151 | - return false; |
|
| 152 | - } |
|
| 153 | - $storage->setBackendOption($name, $value); |
|
| 154 | - } |
|
| 155 | - } |
|
| 156 | - return true; |
|
| 157 | - } |
|
| 34 | + /** @var string human-readable mechanism name */ |
|
| 35 | + private $text; |
|
| 36 | + |
|
| 37 | + /** @var DefinitionParameter[] parameters for mechanism */ |
|
| 38 | + private $parameters = []; |
|
| 39 | + |
|
| 40 | + /** @var string[] custom JS */ |
|
| 41 | + private $customJs = []; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * @return string |
|
| 45 | + */ |
|
| 46 | + public function getText() { |
|
| 47 | + return $this->text; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @param string $text |
|
| 52 | + * @return $this |
|
| 53 | + */ |
|
| 54 | + public function setText($text) { |
|
| 55 | + $this->text = $text; |
|
| 56 | + return $this; |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @param FrontendDefinitionTrait $a |
|
| 61 | + * @param FrontendDefinitionTrait $b |
|
| 62 | + * @return int |
|
| 63 | + */ |
|
| 64 | + public static function lexicalCompare(FrontendDefinitionTrait $a, FrontendDefinitionTrait $b) { |
|
| 65 | + return strcmp($a->getText(), $b->getText()); |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * @return DefinitionParameter[] |
|
| 70 | + */ |
|
| 71 | + public function getParameters() { |
|
| 72 | + return $this->parameters; |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * @param DefinitionParameter[] $parameters |
|
| 77 | + * @return self |
|
| 78 | + */ |
|
| 79 | + public function addParameters(array $parameters) { |
|
| 80 | + foreach ($parameters as $parameter) { |
|
| 81 | + $this->addParameter($parameter); |
|
| 82 | + } |
|
| 83 | + return $this; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * @param DefinitionParameter $parameter |
|
| 88 | + * @return self |
|
| 89 | + */ |
|
| 90 | + public function addParameter(DefinitionParameter $parameter) { |
|
| 91 | + $this->parameters[$parameter->getName()] = $parameter; |
|
| 92 | + return $this; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @return string[] |
|
| 97 | + */ |
|
| 98 | + public function getCustomJs() { |
|
| 99 | + return $this->customJs; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @param string $custom |
|
| 104 | + * @return self |
|
| 105 | + */ |
|
| 106 | + public function addCustomJs($custom) { |
|
| 107 | + $this->customJs[] = $custom; |
|
| 108 | + return $this; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @param string $custom |
|
| 113 | + * @return self |
|
| 114 | + * @deprecated 9.1.0, use addCustomJs() instead |
|
| 115 | + */ |
|
| 116 | + public function setCustomJs($custom) { |
|
| 117 | + $this->customJs = [$custom]; |
|
| 118 | + return $this; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * Serialize into JSON for client-side JS |
|
| 123 | + * |
|
| 124 | + * @return array |
|
| 125 | + */ |
|
| 126 | + public function jsonSerializeDefinition() { |
|
| 127 | + $configuration = []; |
|
| 128 | + foreach ($this->getParameters() as $parameter) { |
|
| 129 | + $configuration[$parameter->getName()] = $parameter; |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + $data = [ |
|
| 133 | + 'name' => $this->getText(), |
|
| 134 | + 'configuration' => $configuration, |
|
| 135 | + 'custom' => $this->getCustomJs(), |
|
| 136 | + ]; |
|
| 137 | + return $data; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + /** |
|
| 141 | + * Check if parameters are satisfied in a StorageConfig |
|
| 142 | + * |
|
| 143 | + * @param StorageConfig $storage |
|
| 144 | + * @return bool |
|
| 145 | + */ |
|
| 146 | + public function validateStorageDefinition(StorageConfig $storage) { |
|
| 147 | + foreach ($this->getParameters() as $name => $parameter) { |
|
| 148 | + $value = $storage->getBackendOption($name); |
|
| 149 | + if (!is_null($value) || !$parameter->isOptional()) { |
|
| 150 | + if (!$parameter->validateValue($value)) { |
|
| 151 | + return false; |
|
| 152 | + } |
|
| 153 | + $storage->setBackendOption($name, $value); |
|
| 154 | + } |
|
| 155 | + } |
|
| 156 | + return true; |
|
| 157 | + } |
|
| 158 | 158 | |
| 159 | 159 | } |
@@ -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 | } |
@@ -21,62 +21,62 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | return [ |
| 24 | - 'routes' => [ |
|
| 25 | - [ |
|
| 26 | - 'name' => 'RateLimitTest#userAndAnonProtected', |
|
| 27 | - 'url' => '/userAndAnonProtected', |
|
| 28 | - 'verb' => 'GET', |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'RateLimitTest#onlyAnonProtected', |
|
| 32 | - 'url' => '/anonProtected', |
|
| 33 | - 'verb' => 'GET', |
|
| 34 | - ], |
|
| 35 | - ], |
|
| 24 | + 'routes' => [ |
|
| 25 | + [ |
|
| 26 | + 'name' => 'RateLimitTest#userAndAnonProtected', |
|
| 27 | + 'url' => '/userAndAnonProtected', |
|
| 28 | + 'verb' => 'GET', |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'RateLimitTest#onlyAnonProtected', |
|
| 32 | + 'url' => '/anonProtected', |
|
| 33 | + 'verb' => 'GET', |
|
| 34 | + ], |
|
| 35 | + ], |
|
| 36 | 36 | |
| 37 | - 'ocs' => [ |
|
| 38 | - [ |
|
| 39 | - 'name' => 'Config#setAppValue', |
|
| 40 | - 'url' => '/api/v1/app/{appid}/{configkey}', |
|
| 41 | - 'verb' => 'POST', |
|
| 42 | - ], |
|
| 43 | - [ |
|
| 44 | - 'name' => 'Config#deleteAppValue', |
|
| 45 | - 'url' => '/api/v1/app/{appid}/{configkey}', |
|
| 46 | - 'verb' => 'DELETE', |
|
| 47 | - ], |
|
| 48 | - [ |
|
| 49 | - 'name' => 'Locking#isLockingEnabled', |
|
| 50 | - 'url' => '/api/v1/lockprovisioning', |
|
| 51 | - 'verb' => 'GET', |
|
| 52 | - ], |
|
| 53 | - [ |
|
| 54 | - 'name' => 'Locking#isLocked', |
|
| 55 | - 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 56 | - 'verb' => 'GET', |
|
| 57 | - ], |
|
| 58 | - [ |
|
| 59 | - 'name' => 'Locking#acquireLock', |
|
| 60 | - 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 61 | - 'verb' => 'POST', |
|
| 62 | - ], |
|
| 63 | - [ |
|
| 64 | - 'name' => 'Locking#changeLock', |
|
| 65 | - 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 66 | - 'verb' => 'PUT', |
|
| 67 | - ], |
|
| 68 | - [ |
|
| 69 | - 'name' => 'Locking#releaseLock', |
|
| 70 | - 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 71 | - 'verb' => 'DELETE', |
|
| 72 | - ], |
|
| 73 | - [ |
|
| 74 | - 'name' => 'Locking#releaseAll', |
|
| 75 | - 'url' => '/api/v1/lockprovisioning/{type}', |
|
| 76 | - 'verb' => 'DELETE', |
|
| 77 | - 'defaults' => [ |
|
| 78 | - 'type' => null |
|
| 79 | - ] |
|
| 80 | - ], |
|
| 81 | - ], |
|
| 37 | + 'ocs' => [ |
|
| 38 | + [ |
|
| 39 | + 'name' => 'Config#setAppValue', |
|
| 40 | + 'url' => '/api/v1/app/{appid}/{configkey}', |
|
| 41 | + 'verb' => 'POST', |
|
| 42 | + ], |
|
| 43 | + [ |
|
| 44 | + 'name' => 'Config#deleteAppValue', |
|
| 45 | + 'url' => '/api/v1/app/{appid}/{configkey}', |
|
| 46 | + 'verb' => 'DELETE', |
|
| 47 | + ], |
|
| 48 | + [ |
|
| 49 | + 'name' => 'Locking#isLockingEnabled', |
|
| 50 | + 'url' => '/api/v1/lockprovisioning', |
|
| 51 | + 'verb' => 'GET', |
|
| 52 | + ], |
|
| 53 | + [ |
|
| 54 | + 'name' => 'Locking#isLocked', |
|
| 55 | + 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 56 | + 'verb' => 'GET', |
|
| 57 | + ], |
|
| 58 | + [ |
|
| 59 | + 'name' => 'Locking#acquireLock', |
|
| 60 | + 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 61 | + 'verb' => 'POST', |
|
| 62 | + ], |
|
| 63 | + [ |
|
| 64 | + 'name' => 'Locking#changeLock', |
|
| 65 | + 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 66 | + 'verb' => 'PUT', |
|
| 67 | + ], |
|
| 68 | + [ |
|
| 69 | + 'name' => 'Locking#releaseLock', |
|
| 70 | + 'url' => '/api/v1/lockprovisioning/{type}/{user}', |
|
| 71 | + 'verb' => 'DELETE', |
|
| 72 | + ], |
|
| 73 | + [ |
|
| 74 | + 'name' => 'Locking#releaseAll', |
|
| 75 | + 'url' => '/api/v1/lockprovisioning/{type}', |
|
| 76 | + 'verb' => 'DELETE', |
|
| 77 | + 'defaults' => [ |
|
| 78 | + 'type' => null |
|
| 79 | + ] |
|
| 80 | + ], |
|
| 81 | + ], |
|
| 82 | 82 | ]; |
@@ -36,91 +36,91 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | interface IRouter { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Get the files to load the routes from |
|
| 41 | - * |
|
| 42 | - * @return string[] |
|
| 43 | - * @since 7.0.0 |
|
| 44 | - * @deprecated 9.0.0 |
|
| 45 | - */ |
|
| 46 | - public function getRoutingFiles(); |
|
| 39 | + /** |
|
| 40 | + * Get the files to load the routes from |
|
| 41 | + * |
|
| 42 | + * @return string[] |
|
| 43 | + * @since 7.0.0 |
|
| 44 | + * @deprecated 9.0.0 |
|
| 45 | + */ |
|
| 46 | + public function getRoutingFiles(); |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @return string |
|
| 50 | - * @since 7.0.0 |
|
| 51 | - * @deprecated 9.0.0 |
|
| 52 | - */ |
|
| 53 | - public function getCacheKey(); |
|
| 48 | + /** |
|
| 49 | + * @return string |
|
| 50 | + * @since 7.0.0 |
|
| 51 | + * @deprecated 9.0.0 |
|
| 52 | + */ |
|
| 53 | + public function getCacheKey(); |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Loads the routes |
|
| 57 | - * |
|
| 58 | - * @param null|string $app |
|
| 59 | - * @since 7.0.0 |
|
| 60 | - * @deprecated 9.0.0 |
|
| 61 | - */ |
|
| 62 | - public function loadRoutes($app = null); |
|
| 55 | + /** |
|
| 56 | + * Loads the routes |
|
| 57 | + * |
|
| 58 | + * @param null|string $app |
|
| 59 | + * @since 7.0.0 |
|
| 60 | + * @deprecated 9.0.0 |
|
| 61 | + */ |
|
| 62 | + public function loadRoutes($app = null); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Sets the collection to use for adding routes |
|
| 66 | - * |
|
| 67 | - * @param string $name Name of the collection to use. |
|
| 68 | - * @return void |
|
| 69 | - * @since 7.0.0 |
|
| 70 | - * @deprecated 9.0.0 |
|
| 71 | - */ |
|
| 72 | - public function useCollection($name); |
|
| 64 | + /** |
|
| 65 | + * Sets the collection to use for adding routes |
|
| 66 | + * |
|
| 67 | + * @param string $name Name of the collection to use. |
|
| 68 | + * @return void |
|
| 69 | + * @since 7.0.0 |
|
| 70 | + * @deprecated 9.0.0 |
|
| 71 | + */ |
|
| 72 | + public function useCollection($name); |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * returns the current collection name in use for adding routes |
|
| 76 | - * |
|
| 77 | - * @return string the collection name |
|
| 78 | - * @since 8.0.0 |
|
| 79 | - * @deprecated 9.0.0 |
|
| 80 | - */ |
|
| 81 | - public function getCurrentCollection(); |
|
| 74 | + /** |
|
| 75 | + * returns the current collection name in use for adding routes |
|
| 76 | + * |
|
| 77 | + * @return string the collection name |
|
| 78 | + * @since 8.0.0 |
|
| 79 | + * @deprecated 9.0.0 |
|
| 80 | + */ |
|
| 81 | + public function getCurrentCollection(); |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * Create a \OCP\Route\IRoute. |
|
| 85 | - * |
|
| 86 | - * @param string $name Name of the route to create. |
|
| 87 | - * @param string $pattern The pattern to match |
|
| 88 | - * @param array $defaults An array of default parameter values |
|
| 89 | - * @param array $requirements An array of requirements for parameters (regexes) |
|
| 90 | - * @return \OCP\Route\IRoute |
|
| 91 | - * @since 7.0.0 |
|
| 92 | - * @deprecated 9.0.0 |
|
| 93 | - */ |
|
| 94 | - public function create($name, $pattern, array $defaults = [], array $requirements = []); |
|
| 83 | + /** |
|
| 84 | + * Create a \OCP\Route\IRoute. |
|
| 85 | + * |
|
| 86 | + * @param string $name Name of the route to create. |
|
| 87 | + * @param string $pattern The pattern to match |
|
| 88 | + * @param array $defaults An array of default parameter values |
|
| 89 | + * @param array $requirements An array of requirements for parameters (regexes) |
|
| 90 | + * @return \OCP\Route\IRoute |
|
| 91 | + * @since 7.0.0 |
|
| 92 | + * @deprecated 9.0.0 |
|
| 93 | + */ |
|
| 94 | + public function create($name, $pattern, array $defaults = [], array $requirements = []); |
|
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Find the route matching $url. |
|
| 98 | - * |
|
| 99 | - * @param string $url The url to find |
|
| 100 | - * @throws \Exception |
|
| 101 | - * @return void |
|
| 102 | - * @since 7.0.0 |
|
| 103 | - * @deprecated 9.0.0 |
|
| 104 | - */ |
|
| 105 | - public function match($url); |
|
| 96 | + /** |
|
| 97 | + * Find the route matching $url. |
|
| 98 | + * |
|
| 99 | + * @param string $url The url to find |
|
| 100 | + * @throws \Exception |
|
| 101 | + * @return void |
|
| 102 | + * @since 7.0.0 |
|
| 103 | + * @deprecated 9.0.0 |
|
| 104 | + */ |
|
| 105 | + public function match($url); |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * Get the url generator |
|
| 109 | - * |
|
| 110 | - * @since 7.0.0 |
|
| 111 | - * @deprecated 9.0.0 |
|
| 112 | - */ |
|
| 113 | - public function getGenerator(); |
|
| 107 | + /** |
|
| 108 | + * Get the url generator |
|
| 109 | + * |
|
| 110 | + * @since 7.0.0 |
|
| 111 | + * @deprecated 9.0.0 |
|
| 112 | + */ |
|
| 113 | + public function getGenerator(); |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * Generate url based on $name and $parameters |
|
| 117 | - * |
|
| 118 | - * @param string $name Name of the route to use. |
|
| 119 | - * @param array $parameters Parameters for the route |
|
| 120 | - * @param bool $absolute |
|
| 121 | - * @return string |
|
| 122 | - * @since 7.0.0 |
|
| 123 | - * @deprecated 9.0.0 |
|
| 124 | - */ |
|
| 125 | - public function generate($name, $parameters = [], $absolute = false); |
|
| 115 | + /** |
|
| 116 | + * Generate url based on $name and $parameters |
|
| 117 | + * |
|
| 118 | + * @param string $name Name of the route to use. |
|
| 119 | + * @param array $parameters Parameters for the route |
|
| 120 | + * @param bool $absolute |
|
| 121 | + * @return string |
|
| 122 | + * @since 7.0.0 |
|
| 123 | + * @deprecated 9.0.0 |
|
| 124 | + */ |
|
| 125 | + public function generate($name, $parameters = [], $absolute = false); |
|
| 126 | 126 | } |
@@ -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 | } |
@@ -28,39 +28,39 @@ |
||
| 28 | 28 | * @since 8.2.0 |
| 29 | 29 | */ |
| 30 | 30 | interface ICompositeExpression { |
| 31 | - /** |
|
| 32 | - * Adds multiple parts to composite expression. |
|
| 33 | - * |
|
| 34 | - * @param array $parts |
|
| 35 | - * |
|
| 36 | - * @return ICompositeExpression |
|
| 37 | - * @since 8.2.0 |
|
| 38 | - */ |
|
| 39 | - public function addMultiple(array $parts = []); |
|
| 31 | + /** |
|
| 32 | + * Adds multiple parts to composite expression. |
|
| 33 | + * |
|
| 34 | + * @param array $parts |
|
| 35 | + * |
|
| 36 | + * @return ICompositeExpression |
|
| 37 | + * @since 8.2.0 |
|
| 38 | + */ |
|
| 39 | + public function addMultiple(array $parts = []); |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Adds an expression to composite expression. |
|
| 43 | - * |
|
| 44 | - * @param mixed $part |
|
| 45 | - * |
|
| 46 | - * @return ICompositeExpression |
|
| 47 | - * @since 8.2.0 |
|
| 48 | - */ |
|
| 49 | - public function add($part); |
|
| 41 | + /** |
|
| 42 | + * Adds an expression to composite expression. |
|
| 43 | + * |
|
| 44 | + * @param mixed $part |
|
| 45 | + * |
|
| 46 | + * @return ICompositeExpression |
|
| 47 | + * @since 8.2.0 |
|
| 48 | + */ |
|
| 49 | + public function add($part); |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Retrieves the amount of expressions on composite expression. |
|
| 53 | - * |
|
| 54 | - * @return integer |
|
| 55 | - * @since 8.2.0 |
|
| 56 | - */ |
|
| 57 | - public function count(); |
|
| 51 | + /** |
|
| 52 | + * Retrieves the amount of expressions on composite expression. |
|
| 53 | + * |
|
| 54 | + * @return integer |
|
| 55 | + * @since 8.2.0 |
|
| 56 | + */ |
|
| 57 | + public function count(); |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Returns the type of this composite expression (AND/OR). |
|
| 61 | - * |
|
| 62 | - * @return string |
|
| 63 | - * @since 8.2.0 |
|
| 64 | - */ |
|
| 65 | - public function getType(); |
|
| 59 | + /** |
|
| 60 | + * Returns the type of this composite expression (AND/OR). |
|
| 61 | + * |
|
| 62 | + * @return string |
|
| 63 | + * @since 8.2.0 |
|
| 64 | + */ |
|
| 65 | + public function getType(); |
|
| 66 | 66 | } |