We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06562a2 commit 06ff3e3Copy full SHA for 06ff3e3
src/Entity/Operation.php
@@ -143,20 +143,25 @@ public function getTags(): Collection
143
*/
144
public function applyRule(TagRule $rule): bool
145
{
146
+ $addedTags = false;
147
+
148
$matches = $rule->isRegex()
149
? \preg_match($rule->getMatchingPattern(), $this->details)
150
: false !== \strpos($this->details, $rule->getMatchingPattern())
151
;
152
153
if ($matches) {
154
foreach ($rule->getTags() as $tag) {
- $this->addTag($tag);
155
+ if (!$this->tags->contains($tag)) {
156
+ $this->addTag($tag);
157
+ $addedTags = true;
158
+ }
159
}
160
- return true;
161
+ return $addedTags;
162
163
- return false;
164
165
166
167
private function addTag(Tag $tag): void
0 commit comments