Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\IPInfo\InfoRetriever; |
4 | |
5 | use MediaWiki\User\UserIdentity; |
6 | |
7 | interface InfoRetriever { |
8 | |
9 | /** |
10 | * Gets the name of the retriever. |
11 | * |
12 | * The name of a retriever must be readable by humans and machines and must be unique. |
13 | * |
14 | * @return string |
15 | */ |
16 | public function getName(): string; |
17 | |
18 | /** |
19 | * Retrieve info about an anonymous user or temporary user account. |
20 | * |
21 | * @param UserIdentity $user |
22 | * @param string|null $ip The IP address used by the user being looked up, |
23 | * or `null` if this data was not available. |
24 | * @return mixed |
25 | */ |
26 | public function retrieveFor( UserIdentity $user, ?string $ip ); |
27 | |
28 | /** |
29 | * Retrieve IP information for a set of IPs associated with a temporary user. |
30 | * |
31 | * @param UserIdentity $user |
32 | * @param string[] $ips The IP addresses to retrieve information for, in human-readable form. |
33 | * @return array Map of IP information keyed by IP address. |
34 | */ |
35 | public function retrieveBatch( UserIdentity $user, array $ips ): array; |
36 | } |