xref: /webtrees/app/Statistics/Repository/Interfaces/UserRepositoryInterface.php (revision 3cfcc809af53e831fa6cafac7b274a2cb407db6e)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.
16 */
17declare(strict_types=1);
18
19namespace Fisharebest\Webtrees\Statistics\Repository\Interfaces;
20
21/**
22 * A repository providing methods for user related statistics.
23 */
24interface UserRepositoryInterface
25{
26    /**
27     * Who is currently logged in?
28     *
29     * @return string
30     */
31    public function usersLoggedIn(): string;
32
33    /**
34     * Who is currently logged in?
35     *
36     * @return string
37     */
38    public function usersLoggedInList(): string;
39
40    /**
41     * Returns the total number of logged in users (visible or anonymous).
42     *
43     * @return int
44     */
45    public function usersLoggedInTotal(): int;
46
47    /**
48     * Returns the total number of anonymous logged in users.
49     *
50     * @return int
51     */
52    public function usersLoggedInTotalAnon(): int;
53
54    /**
55     * Returns the total number of visible logged in users.
56     *
57     * @return int
58     */
59    public function usersLoggedInTotalVisible(): int;
60
61    /**
62     * Get the current user's ID.
63     *
64     * @return string
65     */
66    public function userId(): string;
67
68    /**
69     * Get the current user's username.
70     *
71     * @param string $visitor_text
72     *
73     * @return string
74     */
75    public function userName(string $visitor_text = ''): string;
76
77    /**
78     * Get the current user's full name.
79     *
80     * @return string
81     */
82    public function userFullName(): string;
83
84    /**
85     * Count the number of users.
86     *
87     * @return string
88     */
89    public function totalUsers(): string;
90
91    /**
92     * Count the number of administrators.
93     *
94     * @return string
95     */
96    public function totalAdmins(): string;
97
98    /**
99     * Count the number of administrators.
100     *
101     * @return string
102     */
103    public function totalNonAdmins(): string;
104}
105