if (empty($tag)
|| (! $this->isLoggedIn && startsWith($tag, '.'))
|| $tag === BookmarkMarkdownFormatter::NO_MD_TAG
+ || in_array($tag, $filteringTags, true)
) {
continue;
}
$logMaxCount = $maxCount > 1 ? log($maxCount, 30) : 1;
$tagList = [];
foreach ($tags as $key => $value) {
- if (in_array($key, $filteringTags)) {
- continue;
- }
// Tag font size scaling:
// default 15 and 30 logarithm bases affect scaling,
// 2.2 and 0.8 are arbitrary font sizes in em.
$visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
$filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
$tags = $bookmarkService->bookmarksCountPerTag($filteringTags, $visibility);
- foreach ($filteringTags as $tag) {
- if (array_key_exists($tag, $tags)) {
- unset($tags[$tag]);
- }
- }
if (! empty($_GET['sort']) && $_GET['sort'] === 'alpha') {
alphabetical_sort($tags, false, true);
);
$this->assertEquals(
[
- 'web' => 4,
'cartoon' => 2,
'gnu' => 1,
'dev' => 1,
);
$this->assertEquals(
[
- 'web' => 1,
'html' => 1,
'w3c' => 1,
'css' => 1,
public function testCountLinkPerTagAllWithFilter()
{
$expected = [
- 'gnu' => 2,
'hashtag' => 2,
'-exclude' => 1,
'.hidden' => 1,
public function testCountLinkPerTagPublicWithFilter()
{
$expected = [
- 'gnu' => 2,
'hashtag' => 2,
'-exclude' => 1,
'.hidden' => 1,
{
$expected = [
'cartoon' => 1,
- 'dev' => 1,
'tag1' => 1,
'tag2' => 1,
'tag3' => 1,
->expects(static::once())
->method('bookmarksCountPerTag')
->with(['ghi', 'def'], BookmarkFilter::$PRIVATE)
- ->willReturnCallback(function () use ($allTags): array {
- return $allTags;
+ ->willReturnCallback(function (): array {
+ return ['abc' => 3];
})
;