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:
@@ -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
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user