1
0
mirror of https://github.com/flarum/core.git synced 2025-08-21 23:56:33 +02:00

Flatten logic

With an early return, the method becomes more readable, and the
actual (very small) change from #46 becomes more apparent.
This commit is contained in:
Franz Liedke
2018-02-08 17:14:28 +01:00
parent 26483cc0c5
commit 7667b80bf7

View File

@@ -110,11 +110,15 @@ class UpdateTagMetadata
return; return;
} }
// We do not count private discussions in tags
if ($discussion->is_private) {
return;
}
if (! $tags) { if (! $tags) {
$tags = $discussion->tags; $tags = $discussion->tags;
} }
if (! $discussion->is_private) {
foreach ($tags as $tag) { foreach ($tags as $tag) {
$tag->discussions_count += $delta; $tag->discussions_count += $delta;
@@ -128,4 +132,3 @@ class UpdateTagMetadata
} }
} }
} }
}