Refactor some changes
Co-authored-by: Florian Bosdorff <26360670+bosix@users.noreply.github.com>
This commit is contained in:
parent
4f7378a88d
commit
f99ecf6086
|
|
@ -262,17 +262,17 @@ class Validator
|
|||
*/
|
||||
private static function validateArrayValues(array $attributeValue, string $conditionValue): bool
|
||||
{
|
||||
$result = in_array($conditionValue, $attributeValue, true);
|
||||
if ($result === false) {
|
||||
foreach ($attributeValue as $subValue) {
|
||||
if (is_array($subValue)) {
|
||||
$result = self::validateArrayValues($subValue, $conditionValue);
|
||||
if ($result === true) {
|
||||
break;
|
||||
}
|
||||
if (in_array($conditionValue, $attributeValue, true) === true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($attributeValue as $subValue) {
|
||||
if (is_array($subValue)) {
|
||||
if (self::validateArrayValues($subValue, $conditionValue) === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue