@@ -30,11 +30,11 @@ |
||
30 | 30 | use Sabre\DAV\IFile; |
31 | 31 | |
32 | 32 | abstract class AbstractTrashFile extends AbstractTrash implements IFile, ITrash { |
33 | - public function put($data) { |
|
34 | - throw new Forbidden(); |
|
35 | - } |
|
33 | + public function put($data) { |
|
34 | + throw new Forbidden(); |
|
35 | + } |
|
36 | 36 | |
37 | - public function setName($name) { |
|
38 | - throw new Forbidden(); |
|
39 | - } |
|
37 | + public function setName($name) { |
|
38 | + throw new Forbidden(); |
|
39 | + } |
|
40 | 40 | } |
@@ -40,115 +40,115 @@ |
||
40 | 40 | */ |
41 | 41 | class ExternalSharesController extends Controller { |
42 | 42 | |
43 | - /** @var \OCA\Files_Sharing\External\Manager */ |
|
44 | - private $externalManager; |
|
45 | - /** @var IClientService */ |
|
46 | - private $clientService; |
|
43 | + /** @var \OCA\Files_Sharing\External\Manager */ |
|
44 | + private $externalManager; |
|
45 | + /** @var IClientService */ |
|
46 | + private $clientService; |
|
47 | 47 | |
48 | - /** |
|
49 | - * @param string $appName |
|
50 | - * @param IRequest $request |
|
51 | - * @param \OCA\Files_Sharing\External\Manager $externalManager |
|
52 | - * @param IClientService $clientService |
|
53 | - */ |
|
54 | - public function __construct($appName, |
|
55 | - IRequest $request, |
|
56 | - \OCA\Files_Sharing\External\Manager $externalManager, |
|
57 | - IClientService $clientService) { |
|
58 | - parent::__construct($appName, $request); |
|
59 | - $this->externalManager = $externalManager; |
|
60 | - $this->clientService = $clientService; |
|
61 | - } |
|
48 | + /** |
|
49 | + * @param string $appName |
|
50 | + * @param IRequest $request |
|
51 | + * @param \OCA\Files_Sharing\External\Manager $externalManager |
|
52 | + * @param IClientService $clientService |
|
53 | + */ |
|
54 | + public function __construct($appName, |
|
55 | + IRequest $request, |
|
56 | + \OCA\Files_Sharing\External\Manager $externalManager, |
|
57 | + IClientService $clientService) { |
|
58 | + parent::__construct($appName, $request); |
|
59 | + $this->externalManager = $externalManager; |
|
60 | + $this->clientService = $clientService; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @NoAdminRequired |
|
65 | - * @NoOutgoingFederatedSharingRequired |
|
66 | - * |
|
67 | - * @return JSONResponse |
|
68 | - */ |
|
69 | - public function index() { |
|
70 | - return new JSONResponse($this->externalManager->getOpenShares()); |
|
71 | - } |
|
63 | + /** |
|
64 | + * @NoAdminRequired |
|
65 | + * @NoOutgoingFederatedSharingRequired |
|
66 | + * |
|
67 | + * @return JSONResponse |
|
68 | + */ |
|
69 | + public function index() { |
|
70 | + return new JSONResponse($this->externalManager->getOpenShares()); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @NoAdminRequired |
|
75 | - * @NoOutgoingFederatedSharingRequired |
|
76 | - * |
|
77 | - * @param int $id |
|
78 | - * @return JSONResponse |
|
79 | - */ |
|
80 | - public function create($id) { |
|
81 | - $this->externalManager->acceptShare($id); |
|
82 | - return new JSONResponse(); |
|
83 | - } |
|
73 | + /** |
|
74 | + * @NoAdminRequired |
|
75 | + * @NoOutgoingFederatedSharingRequired |
|
76 | + * |
|
77 | + * @param int $id |
|
78 | + * @return JSONResponse |
|
79 | + */ |
|
80 | + public function create($id) { |
|
81 | + $this->externalManager->acceptShare($id); |
|
82 | + return new JSONResponse(); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @NoAdminRequired |
|
87 | - * @NoOutgoingFederatedSharingRequired |
|
88 | - * |
|
89 | - * @param integer $id |
|
90 | - * @return JSONResponse |
|
91 | - */ |
|
92 | - public function destroy($id) { |
|
93 | - $this->externalManager->declineShare($id); |
|
94 | - return new JSONResponse(); |
|
95 | - } |
|
85 | + /** |
|
86 | + * @NoAdminRequired |
|
87 | + * @NoOutgoingFederatedSharingRequired |
|
88 | + * |
|
89 | + * @param integer $id |
|
90 | + * @return JSONResponse |
|
91 | + */ |
|
92 | + public function destroy($id) { |
|
93 | + $this->externalManager->declineShare($id); |
|
94 | + return new JSONResponse(); |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
98 | - * Test whether the specified remote is accessible |
|
99 | - * |
|
100 | - * @param string $remote |
|
101 | - * @param bool $checkVersion |
|
102 | - * @return bool |
|
103 | - */ |
|
104 | - protected function testUrl($remote, $checkVersion = false) { |
|
105 | - try { |
|
106 | - $client = $this->clientService->newClient(); |
|
107 | - $response = json_decode($client->get( |
|
108 | - $remote, |
|
109 | - [ |
|
110 | - 'timeout' => 3, |
|
111 | - 'connect_timeout' => 3, |
|
112 | - ] |
|
113 | - )->getBody()); |
|
97 | + /** |
|
98 | + * Test whether the specified remote is accessible |
|
99 | + * |
|
100 | + * @param string $remote |
|
101 | + * @param bool $checkVersion |
|
102 | + * @return bool |
|
103 | + */ |
|
104 | + protected function testUrl($remote, $checkVersion = false) { |
|
105 | + try { |
|
106 | + $client = $this->clientService->newClient(); |
|
107 | + $response = json_decode($client->get( |
|
108 | + $remote, |
|
109 | + [ |
|
110 | + 'timeout' => 3, |
|
111 | + 'connect_timeout' => 3, |
|
112 | + ] |
|
113 | + )->getBody()); |
|
114 | 114 | |
115 | - if ($checkVersion) { |
|
116 | - return !empty($response->version) && version_compare($response->version, '7.0.0', '>='); |
|
117 | - } else { |
|
118 | - return is_object($response); |
|
119 | - } |
|
120 | - } catch (\Exception $e) { |
|
121 | - return false; |
|
122 | - } |
|
123 | - } |
|
115 | + if ($checkVersion) { |
|
116 | + return !empty($response->version) && version_compare($response->version, '7.0.0', '>='); |
|
117 | + } else { |
|
118 | + return is_object($response); |
|
119 | + } |
|
120 | + } catch (\Exception $e) { |
|
121 | + return false; |
|
122 | + } |
|
123 | + } |
|
124 | 124 | |
125 | - /** |
|
126 | - * @PublicPage |
|
127 | - * @NoOutgoingFederatedSharingRequired |
|
128 | - * @NoIncomingFederatedSharingRequired |
|
129 | - * |
|
130 | - * @param string $remote |
|
131 | - * @return DataResponse |
|
132 | - */ |
|
133 | - public function testRemote($remote) { |
|
134 | - if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) { |
|
135 | - return new DataResponse(false); |
|
136 | - } |
|
125 | + /** |
|
126 | + * @PublicPage |
|
127 | + * @NoOutgoingFederatedSharingRequired |
|
128 | + * @NoIncomingFederatedSharingRequired |
|
129 | + * |
|
130 | + * @param string $remote |
|
131 | + * @return DataResponse |
|
132 | + */ |
|
133 | + public function testRemote($remote) { |
|
134 | + if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) { |
|
135 | + return new DataResponse(false); |
|
136 | + } |
|
137 | 137 | |
138 | - if ( |
|
139 | - $this->testUrl('https://' . $remote . '/ocs-provider/') || |
|
140 | - $this->testUrl('https://' . $remote . '/ocs-provider/index.php') || |
|
141 | - $this->testUrl('https://' . $remote . '/status.php', true) |
|
142 | - ) { |
|
143 | - return new DataResponse('https'); |
|
144 | - } elseif ( |
|
145 | - $this->testUrl('http://' . $remote . '/ocs-provider/') || |
|
146 | - $this->testUrl('http://' . $remote . '/ocs-provider/index.php') || |
|
147 | - $this->testUrl('http://' . $remote . '/status.php', true) |
|
148 | - ) { |
|
149 | - return new DataResponse('http'); |
|
150 | - } else { |
|
151 | - return new DataResponse(false); |
|
152 | - } |
|
153 | - } |
|
138 | + if ( |
|
139 | + $this->testUrl('https://' . $remote . '/ocs-provider/') || |
|
140 | + $this->testUrl('https://' . $remote . '/ocs-provider/index.php') || |
|
141 | + $this->testUrl('https://' . $remote . '/status.php', true) |
|
142 | + ) { |
|
143 | + return new DataResponse('https'); |
|
144 | + } elseif ( |
|
145 | + $this->testUrl('http://' . $remote . '/ocs-provider/') || |
|
146 | + $this->testUrl('http://' . $remote . '/ocs-provider/index.php') || |
|
147 | + $this->testUrl('http://' . $remote . '/status.php', true) |
|
148 | + ) { |
|
149 | + return new DataResponse('http'); |
|
150 | + } else { |
|
151 | + return new DataResponse(false); |
|
152 | + } |
|
153 | + } |
|
154 | 154 | } |
@@ -33,29 +33,29 @@ |
||
33 | 33 | use OCP\IL10N; |
34 | 34 | |
35 | 35 | class Swift extends Backend { |
36 | - use LegacyDependencyCheckPolyfill; |
|
36 | + use LegacyDependencyCheckPolyfill; |
|
37 | 37 | |
38 | - public function __construct(IL10N $l, OpenStackV2 $openstackAuth, Rackspace $rackspaceAuth) { |
|
39 | - $this |
|
40 | - ->setIdentifier('swift') |
|
41 | - ->addIdentifierAlias('\OC\Files\Storage\Swift') // legacy compat |
|
42 | - ->setStorageClass('\OCA\Files_External\Lib\Storage\Swift') |
|
43 | - ->setText($l->t('OpenStack Object Storage')) |
|
44 | - ->addParameters([ |
|
45 | - (new DefinitionParameter('service_name', $l->t('Service name'))) |
|
46 | - ->setFlag(DefinitionParameter::FLAG_OPTIONAL), |
|
47 | - new DefinitionParameter('region', $l->t('Region')), |
|
48 | - new DefinitionParameter('bucket', $l->t('Bucket')), |
|
49 | - (new DefinitionParameter('timeout', $l->t('Request timeout (seconds)'))) |
|
50 | - ->setFlag(DefinitionParameter::FLAG_OPTIONAL), |
|
51 | - ]) |
|
52 | - ->addAuthScheme(AuthMechanism::SCHEME_OPENSTACK) |
|
53 | - ->setLegacyAuthMechanismCallback(function (array $params) use ($openstackAuth, $rackspaceAuth) { |
|
54 | - if (isset($params['options']['key']) && $params['options']['key']) { |
|
55 | - return $rackspaceAuth; |
|
56 | - } |
|
57 | - return $openstackAuth; |
|
58 | - }) |
|
59 | - ; |
|
60 | - } |
|
38 | + public function __construct(IL10N $l, OpenStackV2 $openstackAuth, Rackspace $rackspaceAuth) { |
|
39 | + $this |
|
40 | + ->setIdentifier('swift') |
|
41 | + ->addIdentifierAlias('\OC\Files\Storage\Swift') // legacy compat |
|
42 | + ->setStorageClass('\OCA\Files_External\Lib\Storage\Swift') |
|
43 | + ->setText($l->t('OpenStack Object Storage')) |
|
44 | + ->addParameters([ |
|
45 | + (new DefinitionParameter('service_name', $l->t('Service name'))) |
|
46 | + ->setFlag(DefinitionParameter::FLAG_OPTIONAL), |
|
47 | + new DefinitionParameter('region', $l->t('Region')), |
|
48 | + new DefinitionParameter('bucket', $l->t('Bucket')), |
|
49 | + (new DefinitionParameter('timeout', $l->t('Request timeout (seconds)'))) |
|
50 | + ->setFlag(DefinitionParameter::FLAG_OPTIONAL), |
|
51 | + ]) |
|
52 | + ->addAuthScheme(AuthMechanism::SCHEME_OPENSTACK) |
|
53 | + ->setLegacyAuthMechanismCallback(function (array $params) use ($openstackAuth, $rackspaceAuth) { |
|
54 | + if (isset($params['options']['key']) && $params['options']['key']) { |
|
55 | + return $rackspaceAuth; |
|
56 | + } |
|
57 | + return $openstackAuth; |
|
58 | + }) |
|
59 | + ; |
|
60 | + } |
|
61 | 61 | } |
@@ -36,19 +36,19 @@ |
||
36 | 36 | * OpenStack Keystone authentication |
37 | 37 | */ |
38 | 38 | class OpenStackV3 extends AuthMechanism { |
39 | - public function __construct(IL10N $l) { |
|
40 | - $this |
|
41 | - ->setIdentifier('openstack::openstackv3') |
|
42 | - ->setScheme(self::SCHEME_OPENSTACK) |
|
43 | - ->setText($l->t('OpenStack v3')) |
|
44 | - ->addParameters([ |
|
45 | - new DefinitionParameter('user', $l->t('Username')), |
|
46 | - new DefinitionParameter('domain', $l->t('Domain')), |
|
47 | - (new DefinitionParameter('password', $l->t('Password'))) |
|
48 | - ->setType(DefinitionParameter::VALUE_PASSWORD), |
|
49 | - new DefinitionParameter('tenant', $l->t('Tenant name')), |
|
50 | - new DefinitionParameter('url', $l->t('Identity endpoint URL')) |
|
51 | - ]) |
|
52 | - ; |
|
53 | - } |
|
39 | + public function __construct(IL10N $l) { |
|
40 | + $this |
|
41 | + ->setIdentifier('openstack::openstackv3') |
|
42 | + ->setScheme(self::SCHEME_OPENSTACK) |
|
43 | + ->setText($l->t('OpenStack v3')) |
|
44 | + ->addParameters([ |
|
45 | + new DefinitionParameter('user', $l->t('Username')), |
|
46 | + new DefinitionParameter('domain', $l->t('Domain')), |
|
47 | + (new DefinitionParameter('password', $l->t('Password'))) |
|
48 | + ->setType(DefinitionParameter::VALUE_PASSWORD), |
|
49 | + new DefinitionParameter('tenant', $l->t('Tenant name')), |
|
50 | + new DefinitionParameter('url', $l->t('Identity endpoint URL')) |
|
51 | + ]) |
|
52 | + ; |
|
53 | + } |
|
54 | 54 | } |
@@ -30,19 +30,19 @@ |
||
30 | 30 | /** @var Application $application */ |
31 | 31 | $application = \OC::$server->query(Application::class); |
32 | 32 | $application->registerRoutes($this, [ |
33 | - 'routes' => [ |
|
34 | - [ |
|
35 | - 'name' => 'Preview#getPreview', |
|
36 | - 'url' => '/preview', |
|
37 | - 'verb' => 'GET', |
|
38 | - ], |
|
39 | - ], |
|
33 | + 'routes' => [ |
|
34 | + [ |
|
35 | + 'name' => 'Preview#getPreview', |
|
36 | + 'url' => '/preview', |
|
37 | + 'verb' => 'GET', |
|
38 | + ], |
|
39 | + ], |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | /** @var $this \OCP\Route\IRouter */ |
43 | 43 | $this->create('files_versions_download', 'apps/files_versions/download.php') |
44 | - ->actionInclude('files_versions/download.php'); |
|
44 | + ->actionInclude('files_versions/download.php'); |
|
45 | 45 | $this->create('files_versions_ajax_getVersions', 'apps/files_versions/ajax/getVersions.php') |
46 | - ->actionInclude('files_versions/ajax/getVersions.php'); |
|
46 | + ->actionInclude('files_versions/ajax/getVersions.php'); |
|
47 | 47 | $this->create('files_versions_ajax_rollbackVersion', 'apps/files_versions/ajax/rollbackVersion.php') |
48 | - ->actionInclude('files_versions/ajax/rollbackVersion.php'); |
|
48 | + ->actionInclude('files_versions/ajax/rollbackVersion.php'); |
@@ -29,12 +29,12 @@ |
||
29 | 29 | $isEnabled = $server->getAppManager()->isEnabledForUser('cloud_federation_api'); |
30 | 30 | |
31 | 31 | if ($isEnabled) { |
32 | - // Make sure the routes are loaded |
|
33 | - \OC_App::loadApp('cloud_federation_api'); |
|
34 | - $capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator()); |
|
35 | - header('Content-Type: application/json'); |
|
36 | - echo json_encode($capabilities->getCapabilities()['ocm']); |
|
32 | + // Make sure the routes are loaded |
|
33 | + \OC_App::loadApp('cloud_federation_api'); |
|
34 | + $capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator()); |
|
35 | + header('Content-Type: application/json'); |
|
36 | + echo json_encode($capabilities->getCapabilities()['ocm']); |
|
37 | 37 | } else { |
38 | - header($_SERVER["SERVER_PROTOCOL"]." 501 Not Implemented", true, 501); |
|
39 | - exit("501 Not Implemented"); |
|
38 | + header($_SERVER["SERVER_PROTOCOL"]." 501 Not Implemented", true, 501); |
|
39 | + exit("501 Not Implemented"); |
|
40 | 40 | } |
@@ -29,12 +29,12 @@ |
||
29 | 29 | */ |
30 | 30 | class GroupMapping extends AbstractMapping { |
31 | 31 | |
32 | - /** |
|
33 | - * returns the DB table name which holds the mappings |
|
34 | - * @return string |
|
35 | - */ |
|
36 | - protected function getTableName(bool $includePrefix = true) { |
|
37 | - $p = $includePrefix ? '*PREFIX*' : ''; |
|
38 | - return $p . 'ldap_group_mapping'; |
|
39 | - } |
|
32 | + /** |
|
33 | + * returns the DB table name which holds the mappings |
|
34 | + * @return string |
|
35 | + */ |
|
36 | + protected function getTableName(bool $includePrefix = true) { |
|
37 | + $p = $includePrefix ? '*PREFIX*' : ''; |
|
38 | + return $p . 'ldap_group_mapping'; |
|
39 | + } |
|
40 | 40 | } |
@@ -29,27 +29,27 @@ |
||
29 | 29 | |
30 | 30 | class PublicOwnerWrapper extends Wrapper { |
31 | 31 | |
32 | - /** @var string */ |
|
33 | - private $owner; |
|
34 | - |
|
35 | - /** |
|
36 | - * @param array $arguments ['storage' => $storage, 'owner' => $owner] |
|
37 | - * |
|
38 | - * $storage: The storage the permissions mask should be applied on |
|
39 | - * $owner: The owner to use in case no owner is found |
|
40 | - */ |
|
41 | - public function __construct($arguments) { |
|
42 | - parent::__construct($arguments); |
|
43 | - $this->owner = $arguments['owner']; |
|
44 | - } |
|
45 | - |
|
46 | - public function getOwner($path) { |
|
47 | - $owner = parent::getOwner($path); |
|
48 | - |
|
49 | - if ($owner === null || $owner === false) { |
|
50 | - return $this->owner; |
|
51 | - } |
|
52 | - |
|
53 | - return $owner; |
|
54 | - } |
|
32 | + /** @var string */ |
|
33 | + private $owner; |
|
34 | + |
|
35 | + /** |
|
36 | + * @param array $arguments ['storage' => $storage, 'owner' => $owner] |
|
37 | + * |
|
38 | + * $storage: The storage the permissions mask should be applied on |
|
39 | + * $owner: The owner to use in case no owner is found |
|
40 | + */ |
|
41 | + public function __construct($arguments) { |
|
42 | + parent::__construct($arguments); |
|
43 | + $this->owner = $arguments['owner']; |
|
44 | + } |
|
45 | + |
|
46 | + public function getOwner($path) { |
|
47 | + $owner = parent::getOwner($path); |
|
48 | + |
|
49 | + if ($owner === null || $owner === false) { |
|
50 | + return $this->owner; |
|
51 | + } |
|
52 | + |
|
53 | + return $owner; |
|
54 | + } |
|
55 | 55 | } |
@@ -31,81 +31,81 @@ |
||
31 | 31 | * @since 20.0.0 |
32 | 32 | */ |
33 | 33 | interface IAppConfig { |
34 | - /** |
|
35 | - * Get all keys stored for this app |
|
36 | - * |
|
37 | - * @return string[] the keys stored for the app |
|
38 | - * @since 20.0.0 |
|
39 | - */ |
|
40 | - public function getAppKeys(): array ; |
|
34 | + /** |
|
35 | + * Get all keys stored for this app |
|
36 | + * |
|
37 | + * @return string[] the keys stored for the app |
|
38 | + * @since 20.0.0 |
|
39 | + */ |
|
40 | + public function getAppKeys(): array ; |
|
41 | 41 | |
42 | - /** |
|
43 | - * Writes a new app wide value |
|
44 | - * |
|
45 | - * @param string $key the key of the value, under which will be saved |
|
46 | - * @param string $value the value that should be stored |
|
47 | - * @return void |
|
48 | - * @since 20.0.0 |
|
49 | - */ |
|
50 | - public function setAppValue(string $key, string $value): void; |
|
42 | + /** |
|
43 | + * Writes a new app wide value |
|
44 | + * |
|
45 | + * @param string $key the key of the value, under which will be saved |
|
46 | + * @param string $value the value that should be stored |
|
47 | + * @return void |
|
48 | + * @since 20.0.0 |
|
49 | + */ |
|
50 | + public function setAppValue(string $key, string $value): void; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Looks up an app wide defined value |
|
54 | - * |
|
55 | - * @param string $key the key of the value, under which it was saved |
|
56 | - * @param string $default the default value to be returned if the value isn't set |
|
57 | - * @return string the saved value |
|
58 | - * @since 20.0.0 |
|
59 | - */ |
|
60 | - public function getAppValue(string $key, string $default = ''): string; |
|
52 | + /** |
|
53 | + * Looks up an app wide defined value |
|
54 | + * |
|
55 | + * @param string $key the key of the value, under which it was saved |
|
56 | + * @param string $default the default value to be returned if the value isn't set |
|
57 | + * @return string the saved value |
|
58 | + * @since 20.0.0 |
|
59 | + */ |
|
60 | + public function getAppValue(string $key, string $default = ''): string; |
|
61 | 61 | |
62 | - /** |
|
63 | - * Delete an app wide defined value |
|
64 | - * |
|
65 | - * @param string $key the key of the value, under which it was saved |
|
66 | - * @return void |
|
67 | - * @since 20.0.0 |
|
68 | - */ |
|
69 | - public function deleteAppValue(string $key): void; |
|
62 | + /** |
|
63 | + * Delete an app wide defined value |
|
64 | + * |
|
65 | + * @param string $key the key of the value, under which it was saved |
|
66 | + * @return void |
|
67 | + * @since 20.0.0 |
|
68 | + */ |
|
69 | + public function deleteAppValue(string $key): void; |
|
70 | 70 | |
71 | - /** |
|
72 | - * Removes all keys in appconfig belonging to the app |
|
73 | - * |
|
74 | - * @return void |
|
75 | - * @since 20.0.0 |
|
76 | - */ |
|
77 | - public function deleteAppValues(): void; |
|
71 | + /** |
|
72 | + * Removes all keys in appconfig belonging to the app |
|
73 | + * |
|
74 | + * @return void |
|
75 | + * @since 20.0.0 |
|
76 | + */ |
|
77 | + public function deleteAppValues(): void; |
|
78 | 78 | |
79 | - /** |
|
80 | - * Set a user defined value |
|
81 | - * |
|
82 | - * @param string $userId the userId of the user that we want to store the value under |
|
83 | - * @param string $key the key under which the value is being stored |
|
84 | - * @param string $value the value that you want to store |
|
85 | - * @param string $preCondition only update if the config value was previously the value passed as $preCondition |
|
86 | - * @throws \OCP\PreConditionNotMetException if a precondition is specified and is not met |
|
87 | - * @throws \UnexpectedValueException when trying to store an unexpected value |
|
88 | - * @since 20.0.0 |
|
89 | - */ |
|
90 | - public function setUserValue(string $userId, string $key, string $value, ?string $preCondition = null): void; |
|
79 | + /** |
|
80 | + * Set a user defined value |
|
81 | + * |
|
82 | + * @param string $userId the userId of the user that we want to store the value under |
|
83 | + * @param string $key the key under which the value is being stored |
|
84 | + * @param string $value the value that you want to store |
|
85 | + * @param string $preCondition only update if the config value was previously the value passed as $preCondition |
|
86 | + * @throws \OCP\PreConditionNotMetException if a precondition is specified and is not met |
|
87 | + * @throws \UnexpectedValueException when trying to store an unexpected value |
|
88 | + * @since 20.0.0 |
|
89 | + */ |
|
90 | + public function setUserValue(string $userId, string $key, string $value, ?string $preCondition = null): void; |
|
91 | 91 | |
92 | - /** |
|
93 | - * Shortcut for getting a user defined value |
|
94 | - * |
|
95 | - * @param string $userId the userId of the user that we want to store the value under |
|
96 | - * @param string $key the key under which the value is being stored |
|
97 | - * @param mixed $default the default value to be returned if the value isn't set |
|
98 | - * @return string |
|
99 | - * @since 20.0.0 |
|
100 | - */ |
|
101 | - public function getUserValue(string $userId, string $key, string $default = ''): string; |
|
92 | + /** |
|
93 | + * Shortcut for getting a user defined value |
|
94 | + * |
|
95 | + * @param string $userId the userId of the user that we want to store the value under |
|
96 | + * @param string $key the key under which the value is being stored |
|
97 | + * @param mixed $default the default value to be returned if the value isn't set |
|
98 | + * @return string |
|
99 | + * @since 20.0.0 |
|
100 | + */ |
|
101 | + public function getUserValue(string $userId, string $key, string $default = ''): string; |
|
102 | 102 | |
103 | - /** |
|
104 | - * Delete a user value |
|
105 | - * |
|
106 | - * @param string $userId the userId of the user that we want to store the value under |
|
107 | - * @param string $key the key under which the value is being stored |
|
108 | - * @since 20.0.0 |
|
109 | - */ |
|
110 | - public function deleteUserValue(string $userId, string $key): void; |
|
103 | + /** |
|
104 | + * Delete a user value |
|
105 | + * |
|
106 | + * @param string $userId the userId of the user that we want to store the value under |
|
107 | + * @param string $key the key under which the value is being stored |
|
108 | + * @since 20.0.0 |
|
109 | + */ |
|
110 | + public function deleteUserValue(string $userId, string $key): void; |
|
111 | 111 | } |