private function resolveChoiceViewValue($selectedValue) { foreach ($this->choiceViews as $choiceView) { if (in_array($selectedValue, [$choiceView->data, $choiceView->value, $choiceView->label])) { return $choiceView->value; } } throw new \InvalidArgumentException(sprintf($this->_errorMessage, $selectedValue)); }