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