Skip to content

Commit 4df428c

Browse files
committed
allow to add {"operator": "OR"} between the entries to allow any of the tag conditions.
1 parent ac7e859 commit 4df428c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Notifications.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ protected function resolve(array $data)
172172
$tags = [];
173173

174174
foreach ($value as $tag) {
175-
if (!isset($tag['key'], $tag['relation'], $tag['value'])) {
176-
continue;
175+
if (isset($tag['key'], $tag['relation'], $tag['value'])) {
176+
$tags[] = [
177+
'key' => (string) $tag['key'],
178+
'relation' => (string) $tag['relation'],
179+
'value' => (string) $tag['value'],
180+
];
181+
} elseif (isset($tag['operator'])) {
182+
$tags[] = ['operator' => 'OR'];
177183
}
178-
// @todo: values must be passed as string so make a validation or cast them to string
179-
$tags[] = [
180-
'key' => $tag['key'],
181-
'relation' => $tag['relation'],
182-
'value' => $tag['value'],
183-
];
184184
}
185185

186186
return $tags;

0 commit comments

Comments
 (0)