Skip to content

Commit 78411a0

Browse files
committed
Patch has one that equals
1 parent 15836fc commit 78411a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/HasOneThatEquals.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ public function evaluate(mixed $input = null): bool
6666
} else {
6767
$value = [];
6868
self::traverseData($field, $this->input, $value);
69-
return ((is_array($value) && in_array($requiredValue, $value)) || ($value == $requiredValue));
69+
70+
if (is_array($value)) {
71+
return (is_array($requiredValue)) ?
72+
!empty(array_intersect($requiredValue, $value)) : in_array($requiredValue, $value);
73+
} else {
74+
return ($value == $requiredValue);
75+
}
7076
}
7177
}
7278

0 commit comments

Comments
 (0)