From 9c3fca6da15938b130395746fedf0ef77f10a4bb Mon Sep 17 00:00:00 2001 From: Michael Grosse <grosse@cosmocode.de> Date: Thu, 22 Dec 2016 11:55:09 +0100 Subject: [PATCH] refactor: Rename method to better convey its purpose --- inc/Form/DropdownElement.php | 2 +- inc/Form/OptGroup.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/Form/DropdownElement.php b/inc/Form/DropdownElement.php index 54e865d86..e70a06dee 100644 --- a/inc/Form/DropdownElement.php +++ b/inc/Form/DropdownElement.php @@ -165,7 +165,7 @@ class DropdownElement extends InputElement { $value_exists = false; /** @var OptGroup $optGroup */ foreach (array_merge(array($this->options), $this->optGroups) as $optGroup) { - $value_exists = $optGroup->setValue($value) || $value_exists; + $value_exists = $optGroup->storeValue($value) || $value_exists; if ($value_exists) { $value = null; } diff --git a/inc/Form/OptGroup.php b/inc/Form/OptGroup.php index ae8b8180f..e7160098d 100644 --- a/inc/Form/OptGroup.php +++ b/inc/Form/OptGroup.php @@ -18,14 +18,14 @@ class OptGroup extends Element { } /** - * Set the element's value + * Store the given value so it can be used during rendering * * This is intended to be only called from within @see DropdownElement::val() * * @param string $value - * @return bool + * @return bool true if an option with the given value exists, false otherwise */ - public function setValue($value) { + public function storeValue($value) { $this->value = $value; return isset($this->options[$value]); } -- GitLab