xref: /webtrees/app/Statistics/Repository/Interfaces/UserRepositoryInterface.php (revision e759aebbec359cf7148227a725fea81907659ae8)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2019 webtrees development team
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16declare(strict_types=1);
17
18namespace Fisharebest\Webtrees\Statistics\Repository\Interfaces;
19
20/**
21 * A repository providing methods for user related statistics.
22 */
23interface UserRepositoryInterface
24{
25    /**
26     * Who is currently logged in?
27     *
28     * @return string
29     */
30    public function usersLoggedIn(): string;
31
32    /**
33     * Who is currently logged in?
34     *
35     * @return string
36     */
37    public function usersLoggedInList(): string;
38
39    /**
40     * Returns the total number of logged in users (visible or anonymous).
41     *
42     * @return int
43     */
44    public function usersLoggedInTotal(): int;
45
46    /**
47     * Returns the total number of anonymous logged in users.
48     *
49     * @return int
50     */
51    public function usersLoggedInTotalAnon(): int;
52
53    /**
54     * Returns the total number of visible logged in users.
55     *
56     * @return int
57     */
58    public function usersLoggedInTotalVisible(): int;
59
60    /**
61     * Get the current user's ID.
62     *
63     * @return string
64     */
65    public function userId(): string;
66
67    /**
68     * Get the current user's username.
69     *
70     * @param string $visitor_text
71     *
72     * @return string
73     */
74    public function userName(string $visitor_text = ''): string;
75
76    /**
77     * Get the current user's full name.
78     *
79     * @return string
80     */
81    public function userFullName(): string;
82
83    /**
84     * Count the number of users.
85     *
86     * @return string
87     */
88    public function totalUsers(): string;
89
90    /**
91     * Count the number of administrators.
92     *
93     * @return string
94     */
95    public function totalAdmins(): string;
96
97    /**
98     * Count the number of administrators.
99     *
100     * @return string
101     */
102    public function totalNonAdmins(): string;
103}
104