Skip to content

Commit

Permalink
Vyhození vyjímky při zadání špatného parametru "mode".
Browse files Browse the repository at this point in the history
  • Loading branch information
Seky committed Mar 11, 2020
1 parent 126fd9f commit a06f7c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function getInvalidValueMode() {
* @return $this
*/
public function setInvalidValueMode($mode) {

if (!in_array($mode, [AjaxSelect\DI\AjaxSelectExtension::INVALID_VALUE_MODE_EXCEPTION, AjaxSelect\DI\AjaxSelectExtension::INVALID_VALUE_MODE_EMPTY])) {
throw new \InvalidArgumentException("Invalid parameter mode, use one of AjaxSelect\DI\AjaxSelectExtension::INVALID_VALUE_MODE_*.");
}

$this->invalidValueMode = $mode;
return $this;
}
Expand All @@ -52,8 +57,6 @@ protected function handleInvalidValues($values) {
? [ ] : NULL;
break;
}

return $this;
}

public function setValue($value) {
Expand Down

0 comments on commit a06f7c9

Please sign in to comment.