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 GrowthExperiments\NewcomerTasks\AddImage; |
4 | |
5 | use GrowthExperiments\NewcomerTasks\TaskType\TaskType; |
6 | use MediaWiki\Title\Title; |
7 | use MWHttpRequest; |
8 | use StatusValue; |
9 | |
10 | /** |
11 | * Interface for interfacing with the image recommendation API, allowing different API endpoints |
12 | * and formats to be used |
13 | */ |
14 | interface ImageRecommendationApiHandler { |
15 | /** |
16 | * Get the API request object used to retrieve image recommendations |
17 | * |
18 | * @param Title $title |
19 | * @param TaskType $taskType |
20 | * @return MWHttpRequest|StatusValue |
21 | */ |
22 | public function getApiRequest( Title $title, TaskType $taskType ); |
23 | |
24 | /** |
25 | * Get an array of suggestion data from response returned by the API |
26 | * |
27 | * @param array $apiResponse |
28 | * @param TaskType $taskType |
29 | * @return ImageRecommendationData[]|StatusValue |
30 | */ |
31 | public function getSuggestionDataFromApiResponse( array $apiResponse, TaskType $taskType ); |
32 | } |