Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig authored and github-actions[bot] committed Mar 22, 2023
1 parent 8f6d8ca commit d4d577d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/DataObject/ClassDefinition/Data/Input.php
Expand Up @@ -328,19 +328,18 @@ public function checkValidity($data, $omitMandatoryCheck = false, $params = [])
{
if (!$omitMandatoryCheck && $this->getRegex() && strlen($data) > 0) {
$throwException = false;
if(in_array('g', $this->getRegexFlags())){
if (in_array('g', $this->getRegexFlags())) {
$flags = str_replace('g', '', implode('', $this->getRegexFlags()));
if (!preg_match_all('#' . $this->getRegex() . '#' . $flags, $data)) {
$throwException = true;
}
}
else{
} else {
if (!preg_match('#' . $this->getRegex() . '#' . implode('', $this->getRegexFlags()), $data)) {
$throwException = true;
}
}

if($throwException) {
if ($throwException) {
throw new Model\Element\ValidationException('Value in field [ ' . $this->getName() . " ] doesn't match input validation '" . $this->getRegex() . "'");
}
}
Expand Down

0 comments on commit d4d577d

Please sign in to comment.