Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-06-30 16:41:57 +0300
committerRobin Appelman <icewind@owncloud.com>2016-06-30 16:44:42 +0300
commitcb3b678b2c63a9fbfdc8cb81e3099c30710a29ac (patch)
tree180c14df7c8684d230663bafe3e1e07145683b02 /apps
parente67615ef0cfba880d1c0ed151f57d78e0fe92dd3 (diff)
hide hidden parameters from list backend/auth parameters
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Command/Backends.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/files_external/lib/Command/Backends.php b/apps/files_external/lib/Command/Backends.php
index 260ea210397..b5d5ad4d184 100644
--- a/apps/files_external/lib/Command/Backends.php
+++ b/apps/files_external/lib/Command/Backends.php
@@ -98,9 +98,7 @@ class Backends extends Base {
$result = [
'name' => $data['name'],
'identifier' => $data['identifier'],
- 'configuration' => array_map(function (DefinitionParameter $parameter) {
- return $parameter->getTypeName();
- }, $data['configuration'])
+ 'configuration' => $this->formatConfiguration($data['configuration'])
];
if ($backend instanceof Backend) {
$result['storage_class'] = $backend->getStorageClass();
@@ -109,4 +107,17 @@ class Backends extends Base {
}
return $result;
}
+
+ /**
+ * @param DefinitionParameter[] $parameters
+ * @return string[]
+ */
+ private function formatConfiguration(array $parameters) {
+ $configuration = array_filter($parameters, function (DefinitionParameter $parameter) {
+ return $parameter->getType() !== DefinitionParameter::VALUE_HIDDEN;
+ });
+ return array_map(function (DefinitionParameter $parameter) {
+ return $parameter->getTypeName();
+ }, $configuration);
+ }
}