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\Extension\ReadingLists; |
4 | |
5 | /** |
6 | * Service interface for turning a domain name into an interwiki prefix so the API can |
7 | * use it in generators. |
8 | */ |
9 | interface ReverseInterwikiLookupInterface { |
10 | /** |
11 | * Look up the interwiki prefix belonging to a domain. |
12 | * There are four possible cases: |
13 | * - the domain is local: return an empty string |
14 | * - the domain is a known interwiki: return the interwiki prefix |
15 | * - the domain is unknown: return null |
16 | * - the domain can be reached through a sequence of interwikis: return the prefixes in an array |
17 | * (where the second prefix is a valid interwiki prefix on the project referred to by the |
18 | * first interwiki prefix, and so on), |
19 | * So e.g. [ 'b', 'de' ] on English Wikipedia would point to German Wikibooks, |
20 | * much like MediaWiki would handle the title 'b:de:Foo'. |
21 | * @param string $domain Wiki domain (could be a full URL, extra parts will be stripped) |
22 | * @return string|array|null Interwiki prefix, or an array of interwiki prefixes, |
23 | * or null if the lookup failed. |
24 | */ |
25 | public function lookup( $domain ); |
26 | } |