Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
ThumborThumbnailImage | |
100.00% |
5 / 5 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getContentType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getContent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\MediaModeration\Media; |
4 | |
5 | use File; |
6 | use ThumbnailImage; |
7 | |
8 | /** |
9 | * Like ThumbnailImage, but can contain the image contents and image content type. |
10 | */ |
11 | class ThumborThumbnailImage extends ThumbnailImage { |
12 | |
13 | private string $content; |
14 | private string $contentType; |
15 | |
16 | public function __construct( File $file, string $url, array $parameters, string $content, string $contentType ) { |
17 | parent::__construct( $file, $url, false, $parameters ); |
18 | |
19 | $this->content = $content; |
20 | $this->contentType = $contentType; |
21 | } |
22 | |
23 | public function getContentType(): string { |
24 | return $this->contentType; |
25 | } |
26 | |
27 | public function getContent(): string { |
28 | return $this->content; |
29 | } |
30 | |
31 | } |