Refactor some changes

Co-authored-by: Florian Bosdorff <26360670+bosix@users.noreply.github.com>
This commit is contained in:
Annika Wolff 2020-06-03 07:12:22 +02:00 committed by GitHub
parent 4f7378a88d
commit f99ecf6086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -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;
}
}
}