Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
StructuredTaskTypeHandler
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
 getRecommendationProvider
n/a
0 / 0
n/a
0 / 0
0
 getSubmissionHandler
n/a
0 / 0
n/a
0 / 0
0
 getSubmitDataFormatMessage
n/a
0 / 0
n/a
0 / 0
0
1<?php
2
3namespace GrowthExperiments\NewcomerTasks\TaskType;
4
5use GrowthExperiments\NewcomerTasks\RecommendationProvider;
6use GrowthExperiments\NewcomerTasks\SubmissionHandler;
7use MessageLocalizer;
8use MessageSpecifier;
9
10/**
11 * TaskTypeHandler subclass for structured tasks. Instead of freeform editing, structured tasks
12 * offer the user to apply a recommendation (typically generated by some machine learning system)
13 * to the article.
14 * @see https://www.mediawiki.org/wiki/Growth/Personalized_first_day/Structured_tasks
15 */
16abstract class StructuredTaskTypeHandler extends TaskTypeHandler {
17
18    /**
19     * Returns the provider which can be used to fetch a recommendation for a given page.
20     * @return RecommendationProvider
21     */
22    abstract public function getRecommendationProvider(): RecommendationProvider;
23
24    /**
25     * Returns the handler which can be used to process a user submission (such as a user
26     * accepting or rejecting a recommendation).
27     * @return SubmissionHandler
28     */
29    abstract public function getSubmissionHandler(): SubmissionHandler;
30
31    /**
32     * Returns a message describing the format of the acceptance/rejectance data that needs to
33     * be provided in some APIs. Should use API documentation conventions.
34     * @param TaskType $taskType
35     * @param MessageLocalizer $localizer
36     * @return MessageSpecifier
37     */
38    abstract public function getSubmitDataFormatMessage(
39        TaskType $taskType,
40        MessageLocalizer $localizer
41    ): MessageSpecifier;
42
43}