File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,15 @@ public function evaluate(mixed $input = null): bool
5353 } else if (!is_array ($ needle ) && is_array ($ haystack )) {
5454 $ result = in_array ($ needle , $ haystack );
5555 } else if (is_array ($ needle )) {
56- $ result = true ;
57- foreach ($ needle as $ n ) {
58- if (is_array ($ haystack )) {
59- if (!in_array ($ n , $ haystack )) {
56+ if (is_array ($ haystack )) {
57+ $ result = !empty (array_intersect ($ needle , $ haystack ));
58+ } else {
59+ $ result = true ;
60+ foreach ($ needle as $ n ) {
61+ if (!str_contains ((string )$ haystack , $ n )) {
6062 $ result = false ;
6163 break ;
6264 }
63- } else if (!str_contains ((string )$ haystack , $ n )) {
64- $ result = false ;
65- break ;
6665 }
6766 }
6867 }
Original file line number Diff line number Diff line change @@ -53,16 +53,15 @@ public function evaluate(mixed $input = null): bool
5353 } else if (!is_array ($ needle ) && is_array ($ haystack )) {
5454 $ result = (!in_array ($ needle , $ haystack ));
5555 } else if (is_array ($ needle )) {
56- $ result = true ;
57- foreach ($ needle as $ n ) {
58- if (is_array ($ haystack )) {
59- if (in_array ($ n , $ haystack )) {
56+ if (is_array ($ haystack )) {
57+ $ result = empty (array_intersect ($ needle , $ haystack ));
58+ } else {
59+ $ result = true ;
60+ foreach ($ needle as $ n ) {
61+ if (str_contains ((string )$ haystack , $ n )) {
6062 $ result = false ;
6163 break ;
6264 }
63- } else if (str_contains ((string )$ haystack , $ n )) {
64- $ result = false ;
65- break ;
6665 }
6766 }
6867 }
You can’t perform that action at this time.
0 commit comments