equal check improvement and tests

This commit is contained in:
Yurii
2026-03-04 15:56:44 +02:00
parent ca136225cb
commit 61677e34e0
2 changed files with 214 additions and 3 deletions
+13 -3
View File
@@ -53,15 +53,25 @@ class Util
}
foreach ($v1 as $i => $itemValue) {
if (is_object($itemValue) && is_object($v2[$i])) {
if (!self::areValuesEqual(AttributeType::JSON_OBJECT, $itemValue, $v2[$i])) {
$otherValue = $v2[$i];
if (is_object($itemValue) && is_object($otherValue)) {
if (!self::areValuesEqual(AttributeType::JSON_OBJECT, $itemValue, $otherValue)) {
return false;
}
continue;
}
if ($itemValue !== $v2[$i]) {
if (is_array($itemValue) && is_array($otherValue)) {
if (!self::areValuesEqual(AttributeType::JSON_ARRAY, $itemValue, $otherValue)) {
return false;
}
continue;
}
if ($itemValue !== $otherValue) {
return false;
}
}