From f4e1a1677ba6436f089cc8ad6aee5c06e71c4177 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 1 Feb 2016 17:44:58 +0100 Subject: Remove magic flags from files_external backend params --- apps/files_external/lib/definitionparameter.php | 26 +++++-------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'apps/files_external/lib') diff --git a/apps/files_external/lib/definitionparameter.php b/apps/files_external/lib/definitionparameter.php index dc7985837f5..27c6af0fcda 100644 --- a/apps/files_external/lib/definitionparameter.php +++ b/apps/files_external/lib/definitionparameter.php @@ -131,27 +131,11 @@ class DefinitionParameter implements \JsonSerializable { * @return string */ public function jsonSerialize() { - $prefix = ''; - switch ($this->getType()) { - case self::VALUE_BOOLEAN: - $prefix = '!'; - break; - case self::VALUE_PASSWORD: - $prefix = '*'; - break; - case self::VALUE_HIDDEN: - $prefix = '#'; - break; - } - - if ($this->isFlagSet(self::FLAG_OPTIONAL)) { - $prefix = '&' . $prefix; - } - if ($this->isFlagSet(self::FLAG_USER_PROVIDED)) { - $prefix = '@' . $prefix; - } - - return $prefix . $this->getText(); + return [ + 'value' => $this->getText(), + 'flags' => $this->getFlags(), + 'type' => $this->getType() + ]; } public function isOptional() { -- cgit v1.2.3