Skip to content

Commit

Permalink
Add regex property to one of required option.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlnk committed Jun 24, 2024
1 parent 76150c5 commit 9ebb903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/widgets/MaskedInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class MaskedInput extends InputWidget
public function init()
{
parent::init();
if (empty($this->mask) && empty($this->clientOptions['alias'])) {
throw new InvalidConfigException("Either the 'mask' property or the 'clientOptions[\"alias\"]' property must be set.");
if (empty($this->mask) && empty($this->clientOptions['regex']) && empty($this->clientOptions['alias'])) {
throw new InvalidConfigException("Either the 'mask' property, 'clientOptions[\"regex\"]' or the 'clientOptions[\"alias\"]' property must be set.");

Check warning on line 136 in framework/widgets/MaskedInput.php

View check run for this annotation

Codecov / codecov/patch

framework/widgets/MaskedInput.php#L136

Added line #L136 was not covered by tests
}
}

Expand Down

0 comments on commit 9ebb903

Please sign in to comment.