Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| ImageContentsLookupStatus | |
100.00% |
7 / 7 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setMimeType | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setImageContents | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getMimeType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getImageContents | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | declare( strict_types=1 ); |
| 3 | |
| 4 | namespace MediaWiki\Extension\MediaModeration\Status; |
| 5 | |
| 6 | use StatusValue; |
| 7 | |
| 8 | /** |
| 9 | * @template T |
| 10 | * @inherits StatusValue<T> |
| 11 | */ |
| 12 | class ImageContentsLookupStatus extends StatusValue { |
| 13 | private string $mimeType; |
| 14 | private string $imageContents; |
| 15 | |
| 16 | /** |
| 17 | * @suppress PhanGenericConstructorTypes |
| 18 | */ |
| 19 | public function __construct() { |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @param string $mimeType |
| 24 | * @internal |
| 25 | * @return $this |
| 26 | */ |
| 27 | public function setMimeType( string $mimeType ) { |
| 28 | $this->mimeType = $mimeType; |
| 29 | return $this; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @param string $imageContents |
| 34 | * @return $this |
| 35 | * @internal |
| 36 | */ |
| 37 | public function setImageContents( string $imageContents ) { |
| 38 | $this->imageContents = $imageContents; |
| 39 | return $this; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Gets the mime type for the image contents found by |
| 44 | * MediaModerationFileContentsLookup::getImageContents. |
| 45 | * |
| 46 | * @return string |
| 47 | */ |
| 48 | public function getMimeType(): string { |
| 49 | return $this->mimeType; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Gets the image contents as found by |
| 54 | * MediaModerationFileContentsLookup::getImageContents. |
| 55 | * |
| 56 | * @return string |
| 57 | */ |
| 58 | public function getImageContents(): string { |
| 59 | return $this->imageContents; |
| 60 | } |
| 61 | } |