Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
91.67% covered (success)
91.67%
11 / 12
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ImageRecommendationTaskType
91.67% covered (success)
91.67%
11 / 12
66.67% covered (warning)
66.67%
2 / 3
3.01
0.00% covered (danger)
0.00%
0 / 1
 getSmallTaskCardImageCssClasses
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLearnMoreLink
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 newFromJsonArray
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace GrowthExperiments\NewcomerTasks\TaskType;
4
5use MediaWiki\Json\JsonUnserializer;
6
7class ImageRecommendationTaskType extends ImageRecommendationBaseTaskType {
8
9    /** @inheritDoc */
10    public function getSmallTaskCardImageCssClasses(): array {
11        return [ 'mw-ge-small-task-card-image-placeholder' ];
12    }
13
14    /** @inheritDoc */
15    public function getLearnMoreLink(): ?string {
16        return null;
17    }
18
19    /** @inheritDoc */
20    public static function newFromJsonArray( JsonUnserializer $unserializer, array $json ) {
21        $taskType = new ImageRecommendationTaskType(
22            $json['id'],
23            $json['difficulty'],
24            $json['settings'],
25            $json['extraData'],
26            self::getExcludedTemplatesTitleValues( $json ),
27            self::getExcludedCategoriesTitleValues( $json )
28        );
29        $taskType->setHandlerId( $json['handlerId'] );
30        return $taskType;
31    }
32
33}