Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| TransformParameterError | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| getHttpStatusCode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Base class for the output of file transformation methods. |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | * @ingroup Media |
| 8 | */ |
| 9 | |
| 10 | namespace MediaWiki\Media; |
| 11 | |
| 12 | /** |
| 13 | * Shortcut class for parameter validation errors |
| 14 | * |
| 15 | * @newable |
| 16 | * @ingroup Media |
| 17 | */ |
| 18 | class TransformParameterError extends MediaTransformError { |
| 19 | |
| 20 | /** |
| 21 | * @stable to call |
| 22 | * |
| 23 | * @param array $params |
| 24 | */ |
| 25 | public function __construct( $params ) { |
| 26 | parent::__construct( 'thumbnail_error', |
| 27 | max( $params['width'] ?? 0, 120 ), |
| 28 | max( $params['height'] ?? 0, 120 ), |
| 29 | wfMessage( 'thumbnail_invalid_params' ) |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | /** @inheritDoc */ |
| 34 | public function getHttpStatusCode() { |
| 35 | return 400; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** @deprecated class alias since 1.46 */ |
| 40 | class_alias( TransformParameterError::class, 'TransformParameterError' ); |