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\AbuseFilter\BlockedDomains; |
| 4 | |
| 5 | use MediaWiki\Extension\AbuseFilter\ServiceNames; |
| 6 | use MediaWiki\Permissions\Authority; |
| 7 | use StatusValue; |
| 8 | |
| 9 | interface IBlockedDomainStorage { |
| 10 | public const SERVICE_NAME = ServiceNames::BlockedDomainStorage; |
| 11 | |
| 12 | /** |
| 13 | * Load the configuration page, with optional local-server caching. |
| 14 | * |
| 15 | * @param int $flags bit field, see IDBAccessObject::READ_XXX |
| 16 | * @return StatusValue The content of the configuration page (as JSON |
| 17 | * data in PHP-native format), or a StatusValue on error. |
| 18 | */ |
| 19 | public function loadConfig( int $flags = 0 ): StatusValue; |
| 20 | |
| 21 | /** |
| 22 | * Load the computed domain blocklist |
| 23 | * |
| 24 | * @return array<string,true> Flipped for performance reasons |
| 25 | */ |
| 26 | public function loadComputed(): array; |
| 27 | |
| 28 | /** |
| 29 | * This doesn't do validation. |
| 30 | * |
| 31 | * @param string $domain domain to be blocked |
| 32 | * @param string $notes User provided notes |
| 33 | * @param Authority $authority Performer |
| 34 | * |
| 35 | * @return StatusValue |
| 36 | */ |
| 37 | public function addDomain( string $domain, string $notes, Authority $authority ): StatusValue; |
| 38 | |
| 39 | /** |
| 40 | * This doesn't do validation |
| 41 | * |
| 42 | * @param string $domain domain to be removed from the blocked list |
| 43 | * @param string $notes User provided notes |
| 44 | * @param Authority $authority Performer |
| 45 | * |
| 46 | * @return StatusValue |
| 47 | */ |
| 48 | public function removeDomain( string $domain, string $notes, Authority $authority ): StatusValue; |
| 49 | } |